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: 
max_potass
Creator
Creator

an If clause with weird behavior

Note: I found a way, that I do not have to use an If clause there, so I do not need an answer anymore, but I am still interested, why this did not work.

Hello everyone,

I currently am realy confused with an if clause... I try the following:

If(Not x=y,a,b)

If x=y I actually get b. But when x is not y I do not get a.

How is this possible?

In actuallity x is a max value of a date, y is a variable (also date). a is another expression in the same chart an b is a bit complicated but actually works. It is not nice to look at but here you go:

If(Not Max({<MMM.YY = ,year = ,Type={'Ist'}>}MMM.YY)=PMM_Date_auto,

[AE Ist],

SUM({<MMM.YY = ,year = >}If(MMM.YY=MonthStart(Today(0)),AE.Netto*UKURS))

/NetWorkDays(MonthStart(Today(0)),MAX({<MMM.YY = ,year = >}True_Date),$(vPublicHolidays))

*NetWorkDays(MonthStart(Today(0)),MonthEnd(Today(0)),$(vPublicHolidays))

+SUM({<MMM.YY = ,year = >}If(MMM.YY<MonthStart(Today(0)) And MMM.YY>=YearStart(Today(0)),AE.Netto*UKURS)))

Has anyone an idea what the problem could be?

10 Replies
sunny_talwar

So, then the if statement is not the problem... it is something else... would you be able to share a sample where this isn't working?