Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Sales from previous year

Hi,

I'm trying to display number on chart. Those number are monthly sales from the current year compare with the last year.

To display the current year; no problem ; --> Sum([Gross Order]

But to display the one from previous year, I don't get it;

I have try

WIth the year : Sum({<Year={$(=max(Year)-1)}>}[Gross Order])

or with the month : Sum({<Month={$(=max(Month)-12)}>}[Gross Order])

None of them works.

Can anyone help me?

P.S. : The dimension I have is DATE which is on the format dd/mm/yy .

Thanks in advance

Tags (1)
6 Replies
sunny_talwar
Not applicable

Re: Sales from previous year

Khan_Mohammed
Not applicable

Re: Sales from previous year

Maybe Use

if(InYear(TempDate, today(),-1), 1, 0) as LastYearFlag,

In your Master Calendar script and in front end

Sum({<LastYearFlag={1}>}[Gross Order])



I'm not sure if it will work or no...

Not applicable

Re: Sales from previous year

To get the Gross order Value of the Previous Year when you click on the current year

Use this expression:

Sum({$<Year={$(=max(Year)-1)}>}[Gross Order])

Not applicable

Re: Sales from previous year

Hi

Thanks for the help. Almost the same as what I try but unfortunately, it doesn't work...

It looks like it doesn't take into account the "(Year)-1".

vinieme12
Not applicable

Re: Sales from previous year

try Sum({<Year={'$(=max(Year)-1)'}>}[Gross Order])

or create flags

Period Presets: Compare Periods on the fly

parimikittu
Not applicable

Re: Sales from previous year

Sum({<Year={$(=max(Year)-1)}>}[Gross Order]). This will not wok unless u have selection on Date dimension. So

please use below

Sum({<Year={$(=max({1}Year)-1)}>}[Gross Order]). Let us know incase of any issues.