Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare date from previous year with date from current year

Hi there,

i have still the problem, that i am not able to compare a date from previous year with a date of the current year.

i.e. 15.05.2013 vs. 15.05.2014

I want to show the last 30 days vs the same days in the previous year.

I am using a line chart with these dimensions:     Date   (=if(Datefield>=date(today()-30), Datefield)

                                                                               Plattform    (there are about 10 plattforms)

Field for formula:                                                    amount of article

And now i want to have two lines in the chart: one for the current year and one (as pointed line) for previous year.

I have allready tried this in expressions, but no data will shown:

=AVG({$<FieldYear={$(=Max(FieldYear))}>}[Article Online])

=AVG({$<FieldYear={$(=Max(FieldYear)-1)}>}[Article Online])

Could somebody help me?

Thanks and best regards

Sabrina

something like this; in this example the 2nd line for prev year is missing!

example.jpg

7 Replies
Not applicable
Author


Hi,

Try like this

=AVG({$<FieldYear={$('=Max(FieldYear'))}>}[Article Online])

=AVG({$<FieldYear={$('=Max(FieldYear)-1')}>}[Article Online])

Not applicable
Author

Doesn't work 😞

No data available... any idea else?

Not applicable
Author

Mistake by myself!

This is the result of your changes, but now the plattform is missing (Agenda for years) 😞

example2.jpg

Not applicable
Author

Hi,

I think in dimension that is  Date   (=if(Datefield>=date(today()-30), Datefield)

in dimension values it has only this year values below 30 days only so it doesn't show previous year data as a line.bcoz in the dimension we have only values like 1/10/2014,2/10/2014.......29/10/2014

here we don't have 2013 values in dimension so it won't show the line.

Not applicable
Author

Hi,

this could be the reason!

I am new in using Set Analysis, how can i conform the expressions that i get the same last 30 days?

Thanks in advance und best regards,

Sabrina

Not applicable
Author

Hi,

Try to impliment in some other charts gauge and text objects.it will differenstiate the curr year and prev year [Article Online]

Not applicable
Author

Hi Rakesh,

i tried to switch into other diagrams but nothing works fine for me.

I think your idea regarding dimension date is the right way.

I want to implement a set analysis function to the expressions, which give me also the last 30 days.
Could you help me how to build this?

Thanks and regards

Sabrina