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

Formula Question- Variance between two dates selected

Hello:

I would like to be able to select two dates in a line graph and have a table calculate the difference between the two. Is this possible? I included a screenshot to help.

Thank you,

Megan

Screenshot.png

5 Replies
Channa
Specialist III
Specialist III

yes

write two set expressions

=Sum({$<date={"max(date)"}>} Budget) - Sum({$<date={"min(date)"}>} Budget)

it will do

try

 

Channa
megan_deboer
Partner - Contributor II
Partner - Contributor II
Author

Thanks Channa, Is the 'budget' in the column supposed to be the values I'm using or keep it as 'budget'?

megan_deboer
Partner - Contributor II
Partner - Contributor II
Author

Additional questions for you sorry, I'm new to set expressions. 

I'm setting two separate set expressions or one? I'm just a little confused. I appreciate the help!

 

Channa
Specialist III
Specialist III

if you like to see only difference in table only one expression which is difference

 

if you like to see 3 columns Minimum from select date , max from select date and difference use 3 expressions

Mindate:= Sum({$<date={"min(date)"}>} Budget)

max date:=Sum({$<date={"max(date)"}>} Budget)

difference :=Sum({$<date={"max(date)"}>} Budget) - Sum({$<date={"min(date)"}>} Budget)

 

Channa
megan_deboer
Partner - Contributor II
Partner - Contributor II
Author

Hi Channa:

thanks for the help, the formula is stating 'ok' at the bottom however, nothing is displaying.  I attached a screenshot. Any ideas? 

Again, I really appreciate your help.

Best, 

Megan