Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to create a variable in the script that holds a certain value that updates every time there is a reload.
The value should iterate over from 1993 to 1998.
So for example it is 1993
After I reload it should be 1994
Then the next reload it should be 1995
...
Until 1998, after 1998 it should again hold the value of 1993.
Here is the basic of what I want to do:
SET vYear = <value of year based on above>;
LOAD
$(vYear) as CurrentYear,
<fields>
From file.txt;
How is it possible to create a variable like this please?
May be this
LET vYear = If(vYear = 1998, 1993, $(vYear) + 1);
Hi Sunny,
It's a good idea, however I get 1, 2, 3 as results and not 1993, 1994 etc. Any ideas why?
I am a little confused, are you trying to loop through these values during a single reload? or are you trying to increment by 1 every time you reload?
Have you initialized your vYear variable once to 1993?
Hi Sunny,
I am trying to loop through them. So initial value could be 1993, then after the next reload it would be 1994, then next reload it would be 1995 etc. Until 1998, after this it loops through again and start at 1993.
Try this may be:
LET vYear = If(vYear <> 1998, $(vYear) + 1, 1993);
or
LET vYear = If(Len(Trim(vYear)) = 0, 1993, If(vYear = 1998, 1993, $(vYear) + 1);
try this?
If $(vFirst)=0 then
LET vYear=1992;
end if;
LET vYear = If(vYear = 1998, 1993, $(vYear) + 1);// i copied sunny's idea here...
set vFirst=1;
Hi,
I would like to create a variable in the front end
The variable should iterate from the year 2010 to the current year
can you suggest how to iterate year in front end variable