
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If Else Qliksense Load Script
Migrating an App to Qliksense, the following script worked as intended in Qlikview, but is throwing syntax errors in QS.
the variable governs whether or not i want to load in where CustomerNLCStatusAsOfCall = 'N/L' or not. This greatly reduces the data, but sometimes i want to load them in for other analysis. \
if $(vLoadClients) = 0, Load this Script, Load other script
------------------------------------------------------------------------
if $(vLoadClients) = 0
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
and (CustomerNLCStatusAsOfCall = 'N/L' or CustomerNLCStatusAsOfCall = 'UnMatched')
;
Else
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
;
Endif;
- Tags:
- qlik sense
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Qlik Sense, you need a "then" with If and space between endif. Try this:
if $(vLoadClients) = 0 then
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
and (CustomerNLCStatusAsOfCall = 'N/L' or CustomerNLCStatusAsOfCall = 'UnMatched')
;
Else
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
;
End if

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Qlik Sense, you need a "then" with If and space between endif. Try this:
if $(vLoadClients) = 0 then
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
and (CustomerNLCStatusAsOfCall = 'N/L' or CustomerNLCStatusAsOfCall = 'UnMatched')
;
Else
Activities: NoConcatenate
Load * Resident ActivitiesTEMP
where year(ActivityDate) >= '$(vResultsThruYear)'
;
End if

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
