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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
goos_it
Contributor II
Contributor II

nested IF doesn´t evaluate correctly in script

Hello Qlik-Specialists,

I have a problem which drives me mad. I build a small nested IF to flag certain datarows depending on a comparison of the date (%Date) and today(). When I use the block in a table visualisation it works as expected, but when moving it to the script the results are completely wrong. The "%Date" ist the date of the datarow, the left column "Fehlende Projektbuchung seit 29.09." is the one which is calculated in the table-measure und the "MissingTimeBooking.Status Fehlende Zeitbuchung" is the dimension which is calculated in the script with exactly the same formula (Besides differing fieldnames of course). I'm in the qlik cloud (concering the QlikSense version). Is it me or is it a bug?

Any hint is appreciated!

BR Stephan

if(floor(%Date) = floor(today()-3), dual('Fehlende Buchung in 48h',-1),
  		if( floor(%Date) = floor(today()-4), dual('Fehlende Buchung in 72h',-1),
  			if( floor(%Date) <= floor(today()-5), dual('Fehlende Buchung > 72h',-1) ,null()
  	))) as [Status Fehlende Zeitbuchung],

Code block an result in tableCode block an result in table

 

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

The dual() is wrong because the leading numeric value is in all branches -1 which means the results are all the same. Just change them to (+-) 1, 2, 3.

View solution in original post

2 Replies
marcus_sommer

The dual() is wrong because the leading numeric value is in all branches -1 which means the results are all the same. Just change them to (+-) 1, 2, 3.

goos_it
Contributor II
Contributor II
Author

Oh my gosh, that's just so obvious! Thank you so much for finally opening my eyes!

BR Stephan