Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

laylagirl
New Contributor III

How to calculate based on current selection ?

Here is expression : sum ( sales) 

Here is dimension : Yr = ( 2015, 2016, 2017)

How do I write expression so it returns values for ANY YEAR selected  minus prior year ?

1 Solution

Accepted Solutions
greeshma_k
Contributor III

Re: How to calculate based on current selection ?

sum({<Yr= {'$(=max(Yr))'}>}sales) - sum({<Yr= {'$(=max(Yr)-1)'}>}sales)

1 Reply
greeshma_k
Contributor III

Re: How to calculate based on current selection ?

sum({<Yr= {'$(=max(Yr))'}>}sales) - sum({<Yr= {'$(=max(Yr)-1)'}>}sales)