Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year-1 is ignored in Set Analysis

Good morning (again) from Germany,

I have a little problem with Set Analysis and the previous year.

(Count({$<MasterYear = {"=$(=(MasterYear-1))"},

DateType = {'Contract_End_Real'}>}DISTINCT(Contract_Key)))

The expression should count the Contract_Keys for the selected Year-1.

It is working very well with smaller (<), greater(>), <= or >=. Only with equal it doesn't work. The -1 is actually ignored in that case with equal

Any idea why?

1 Solution

Accepted Solutions
pokassov
Specialist
Specialist

Hi!

Could you try this?

(Count({$<MasterYear = {$(=(MasterYear-1))},

DateType = {'Contract_End_Real'}>}DISTINCT(Contract_Key)))

View solution in original post

4 Replies
pokassov
Specialist
Specialist

Hi!

Could you try this?

(Count({$<MasterYear = {$(=(MasterYear-1))},

DateType = {'Contract_End_Real'}>}DISTINCT(Contract_Key)))

rubenmarin

Hi Targa, I'll suggest to set the expression ina table without expression label, this way, setting the mouse on the title you can see how QV is expanding "=$(=(MasterYear-1))", looking this will give you a hint of what's happening.

Maybe is beacuse this is returning null() because MasterYear has more than one possible value, if this is the case you can use:"=$(=(Max(MasterYear)-1))"

Not applicable
Author

Thank you, its working.

But, can you explain it a little bit why?

Not applicable
Author

Thats right.

The calculation doesn't work if you select more than one year. But it seems that this was not the problem.

Actually, for the complete calculation/analyse (That was only one part from a measure calculation) you would never select more than one year. That would be pointless

So the solution from the russian guy is enough.