Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts
I need to sum up the two lines to one correct formula. If there are records which fulfill Flag = 'X' and Flag<>'X' the current Master Item (measure) doesn't work. Do you have a solution? Thank you!
if([Cap_D_W]='5' and [Flag]='X', count([Date]) * [Difference of Time] ,
if([Cap_D_W]='5' and [Flag]<>'X', networkdays ([Date], [Date])* [Cap_H_D]
))
Nested if work in Qlik,
After changing all the values from your equations to "1" I still get the error which means that the brackets are wrong.
Nested if work in Qlik,
After changing all the values from your equations to "1" I still get the error which means that the brackets are wrong.
But how can [Flag] simultaneously be X and NOT X?
In any case I would clean it up as:
if([Cap_D_W]='5', if([Flag]='X'), count([Date]) * [Difference of Time] , networkdays ([Date], [Date])* [Cap_H_D]))
Which will evaluate to Null if [Cap_D_W] <> '5'
If [Flag] = 'X' and somehow is also <>'X', it will evaluate to "count([Date]) * [Difference of Time]" (because it will evaulate the 'X' first)
And if [Flag] = 'Y' it will evaluate to "networkdays ([Date], [Date])* [Cap_H_D]"
[Flag] can't be X and NOT X in the same time.
Your equation is bad, because "if" expression takes 2-3 parameters insted 1.
Read this article: https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/Conditi...
Define your condition what to do, what else to be. If you have two options: make a condition for the first and pass the second as "else".