4 Replies Latest reply: Apr 2, 2015 3:48 AM by Denis Windisch

# 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?

• ###### Re: Year-1 is ignored in Set Analysis

Hi!

Could you try this?

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

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

• ###### Re: Year-1 is ignored in Set Analysis

Thank you, its working.

But, can you explain it a little bit why?

• ###### Re: Year-1 is ignored in Set Analysis

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))"

• ###### Re: Year-1 is ignored in Set Analysis

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.