Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
benz-ait
Contributor II
Contributor II

How to make 2 measures ( measures of the current Year VS Year -1) in same graph

Hello

I would like to know how to put in the same Graphic the elements below:

 dimension:  Date ( Year/Month)

measure 1: Nb of Visitors of Year N ( the green line)

measure 2: Nb of Visitors of Year  N-1  ( 2018) ( the blue line)

as you can see in the screen below

Q.PNG

BR

Labels (2)
3 Replies
Lisa_P
Employee
Employee

Set analysis is the answer.
You should really only show the Month as dimension in this case.
Would be good if you had a year field as well.
IF you don't have them, you can derive them using the Year and Month functions when you load your data in either the Data Load Editor or the Data Manger.
Guessing your field names it should look something like this:
Measure 1: Sum({<Year={$(=Max(Year))}>}[Nb of Visitors])
Measure 2: Sum({<Year={$(=Max(Year)-1)}>}[Nb of Visitors])

benz-ait
Contributor II
Contributor II
Author

Hello Lisa and thank you for your response

I juste tried your solution and it's KO

when I select for exemple on the calender 10/2019

the expect resultat should be like this

Dimension: oct 2019

Measure 1 : Nb of Visitors of oct 2019 ( 3450 ) 

Measure 2: Nb of Visitors of oct 2018 (500  ) 

but here what I get :

Dimension: oct 2019

Measure 1 : Nb of Visitors of oct 2019  ( 3450 ) 

Measure 2: 0  ( it should be 500 ) 

do you have any other propostion please ?

 

dwforest
Specialist II
Specialist II

Measure 1: Sum({<Year={$(=Max({1} Year))}>}[Nb of Visitors])
Measure 2: Sum({<Year={$(=Max({1} Year)-1)}>}[Nb of Visitors])