Page 1 of 1

How can I use IF with looping in GAMS?

Posted: Sun Feb 05, 2023 4:16 pm
by Agustino
Hi! I am a beginner level in this program. I try to improve this loop according to this condition. The details are as follows:
image.png
When CUTI(k) = CUTI(k)-4 then,
If the result shows this CUTI(k) value greater than 0, then print this CUTI(k) value.
If the result shows CUTI(k) value less than 0, then print this CUTI(k) value is added 12 with showing a word "But last year" in display, e.g. 10 But last year

I am not sure this loop is correct and enough to add this condition. Look forward to seeing your recoomendation. :)