You only forget to close one parenthesis (something you could have find yourself). A good way to test your stuff is using small sets and a known parameter, so you can do the calculation by hand and check it this way.
Here an example:

set j /1*3/, k /1*3/, l /1*3/, t /1*3/;
parameter x;
x(k) = k.val;
parameter test;
test = sum(j$(ord(j) gt 1), (1 - sqrt(sum((l,t), power(sum(k$(ord(k) <= ord(j) and ord(k) >= 2), x(k) - x(k-1)),2)))));
display test;