Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi I have two variables
Let vCurWeek = replace(WeekName(Today()), '/', '');
Let vLastWeek = Replace(WeekName(Today()-7), '/', '');
which gives me vCurWeek=201115 and vLastWeek=201114
now I want a loop
For i= 0 to 'End of period'
That means for Example if I consider 4 weeks[201114-201117)
How to use that variable in a loop like
For i= 0 to ($(vLastWeek)+4)-1
....
Next i
This does not work. Any idea?
Regards
Sravan
Hi Sravan,
I'm not sure if I understood you, but the solution seems to be:
For i= $(vLastWeek) to ($(vLastWeek)+3)
....
Next i
Is this what you need?
Regards,
Fernando
Hi Sravan,
I'm not sure if I understood you, but the solution seems to be:
For i= $(vLastWeek) to ($(vLastWeek)+3)
....
Next i
Is this what you need?
Regards,
Fernando
hi Fernando,
That was easy. Thanks! Sometime small things are overseen, I am trying on this.
http://community.qlik.com/forums/t/44199.aspx
can you help me realise?
Thanks once again.
Regards
Sravan
Hi Sravan,
glad to help.
One thing you must have in mind is when your end of period goes to the next year.
For example 201150 to 201202. The for loop wont work correctly, and you'll need no treat these situations.
Regards,
Fernando