Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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)
1 Solution

Accepted Solutions
Sayed_Mannan
Creator II
Creator II

Hi, Try this in script

 

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

View solution in original post

2 Replies
Sayed_Mannan
Creator II
Creator II

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)