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: 
KIdriss
Contributor II
Contributor II

Compared to a reference year

Hello,

I would like to know how to compare a value of a year compared to a reference year. The reference year is 2000

I create a Line chart.

- Dimension: colDate.autoCalendar.Year

- Measure:  comparison with the reference year

I added the code below in Measure but I get 0 for each years. 

 

(
	(
  		Sum(colValue) - Sum({<[colDate.autoCalendar.Year] = {"2000"}>} colValue)
	) / Sum({<[colDate.autoCalendar.Year] = {"2000"}>} colValue)
) * 100

 

 

 

 
 

 

 

Labels (1)
1 Solution

Accepted Solutions
jochem_zw
Partner Ambassador
Partner Ambassador

Try something like this:

( ( Sum(colValue) - Sum(Total {<[colDate.autoCalendar.Year] = {"2000"}>} colValue))
/
Sum(Total {<[colDate.autoCalendar.Year] = {"2000"}>} traf_aer_pax)) * 100

View solution in original post

2 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

Try something like this:

( ( Sum(colValue) - Sum(Total {<[colDate.autoCalendar.Year] = {"2000"}>} colValue))
/
Sum(Total {<[colDate.autoCalendar.Year] = {"2000"}>} traf_aer_pax)) * 100
KIdriss
Contributor II
Contributor II
Author

Hello, thank for your help.