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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rmadursk
Contributor III
Contributor III

Simple If statement exits script

This one is almost embarrassing. But, they say there's no dumb questions...

Set vLastActionTime = '1';

If($(vLastActionTime = 1, Trace $(vLastActionTime));

Seems pretty simple, but all this does is exit my data load script.  If I run the Trace command before the conditional the value is 1.  I started with a more complex expression but can't seem to get anything to work.  I've probably tried a couple of dozen different syntax combinations to make this simple thing work.  It has to be some fundamental issue that I just can't find in the documentation. I can see in the debug window that the variable gets set.

Labels (3)
1 Solution

Accepted Solutions
Bhushan_Mahajan
Creator II
Creator II

@rmadursk Try this : 

Set vLastActionTime = 1;

If '$(vLastActionTime)' ='1' then
trace $(vLastActionTime);
endif;

View solution in original post

2 Replies
Bhushan_Mahajan
Creator II
Creator II

@rmadursk Try this : 

Set vLastActionTime = 1;

If '$(vLastActionTime)' ='1' then
trace $(vLastActionTime);
endif;

rmadursk
Contributor III
Contributor III
Author

This works for me. I played around with it, and it also works if the 1 in the condition is not quoted.  I'm glad the if...endif is the example too because I will have a couple of conditions that need to be met, and I think it will be easier to write them using that syntax. 

Thank you