2 Replies Latest reply: Dec 6, 2012 7:17 AM by Staffan Johansson

# Set expression compare

Hi, Here is my problem:

Selected Year 2011.

I have a customer with no sale in Dec 2011, YTD LY (2010) will only show me sale to Nov, ihave sale in dec 2010.

My expression for YTD LY says <=max(Month) but in this case max month will be Nov.

sum({\$<Year = {\$(=only(Year)-1)}, Month = {"<=\$(=max(Month))"}>}Invoiced

Qlikview gives me the "correct" values based on the expression, but how should i solve this issue?

The report is dynamic so when i choose for ex okt, okt 2010 will be higlighted in YTD LY.

sum({\$<Year = {\$(=only(Year)-1)}, Month = {"<=\$(=max({1} Month))"}>}Invoiced)

will give me the correct value, but will be static and show me sale Jan-Dec no matter what.

• ###### Re: Set expression compare

Is this what you need?

sum({\$<Year = {\$(=only(Year)-1)}, Month = {"<=\$(=max({\$<Year = {\$(=only(Year)-1)}>} Month))"}>}Invoiced

• ###### Re: Set expression compare

Thank Gysbert,

I will remember set expression like this in future

Works as I wanted.