Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Neha121
Contributor III
Contributor III

if condition not working in script

Hi,

  I want to define a flag with restriction --->  if( num("Claimant Age") <= 17,1,0). this works fine when I put this code in chart/Table however If I use the same code in script it doesn't work.. can anyone guide me what the problem might be..

Labels (4)
2 Replies
Sayed_Mannan
Creator
Creator

Hi, Try this in script

 

if( Num#("Claimant Age") <= 17, 1, 0)

Vegar
MVP
MVP

If you still have trouble after @Sayed_Mannan 's suggested solution, then try addig trim(), I often found that function to be helpful in similar situations. 

if( Num#(trim("Claimant Age")) <= 17, 1, 0)