Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
wassimharfoush
Partner - Contributor II
Partner - Contributor II

Compare current sum Rev VS last year sum Rev

I am trying to compare the sum of Revenue for period based on current selection of a DateField VS The same period for

previous year and I am using the expression for previous year period:

Sum({<Datefield={'$(=addyears(DateField-1))'}>}Rev)

That works when the user select a single period but doesn't work when the user select multi period.

24 Replies
muniyandi
Creator III
Creator III

Hi Alec,

Now you can select the 9/1/2013 , 7/1/2014 date, then  you will check expected result and previous year expression result. Now will see your expected result.

Thanks,

Muni

alec1982
Specialist II
Specialist II

You are the best! Thank you for all your help!

muniyandi
Creator III
Creator III

Hi,

U got answer. Mark it correct answer and close this thread.

Thanks

Muni

muniyandi
Creator III
Creator III

Hi Alec,

Close this threat .

Thanks,

Muni

Not applicable

Walid,

I used your solution for a similar problem, I am very new to QlikView and can't understand why this solution would bring the same value as my current year selection.

For CY sales pounds: Sum([Sales Pounds])

For LY sales pounds: Sum({$-1<[Fiscal Year]={"$(=AddYears([Fiscal Year],0)-1)","$(=AddYears(Min([Fiscal Year]),0)-1)"}>}[Sales Pounds])

Result: The exact same value.

Thanks,

Tim