Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ITStagiair
Contributor II
Contributor II

If script help

Hey I am a beginner to Qlik and need some help with the if script. When I try this code it gives an error. Can someone help me with it?

Labels (3)
3 Replies
Mark_Little
Luminary
Luminary

Hi @ITStagiair 

The syntax is Different in Qlik.

If num = 1 then 1 else 0 is written IF(NUM=1,1,0) The then and else and just replaced by ','. 

 

ITStagiair
Contributor II
Contributor II
Author

I don't understand how to change my script with this syntax. When I change the syntax it still gives an error.

RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @ITStagiair 

I could be wrong, but your error is in the “next()” as this I think it doesn’t exists. You can read the current and previous row but not next.

So, using flags, you should read comparing current and previous and then with a resident load and ordering in the opposite direction comparing  again de current with previous.

bit complicated to explain, I hope you got the idea.

best,