I have a question regarding sum limits.
I can find how to sum over an entire set, which is not that difficult.
When trying to find how to sum up to some limit, i cannot find anything on how to do this in GAMS.
This is (one of the) function(s) i’d like to model:

∑_(t=1)^(f_j-g_j+e_j) X_ajt ≥1,
(the sum of X_ajt from t=1 to (f_j-g_j+e_j))

If you have a sets that uses numbers instead of strings, you can sum as follows:

set i /1*10/;
sum(i$(i.val > 5), x(i));

.val gives you the numerical value of the set element (which is treated as a string, even when it is a number, so you can’t use $(i >5)).

If you have strings as set elements, you can use ord(), which gives you the place in the set (e.g. first element has order 1).

set i /i1*i10/;
sum(i$(ord(i) > 5, x(i));

Be aware that ord() not always gives you the number in the set itself (especially if you use subsets). To be 100% sure, I usually write some code to see the ord() of the set elements: