Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
saviostrazzullo
Contributor III
Contributor III

Difference of measure between two selected dates

Hi,

I have a table with 2 fields: a date  and a measure. I can select 2 date and I would like to have the difference between the two measure selected.

DateMeasure
1/1/201636
1/2/201644
1/3/201678
1/4/201632
1/5/201672
1/6/201696

If I select 1/1/2016 and 1/6/2016 I would have 96 - 36 = 60

I used the function Sum(Measure) - Below (Sum (Measure)) but it seem I can't order the result. What is the best way to calculate the difference of mesure between two date and order the result?

Thank you

Savio

4 Replies
sunny_talwar

Are you wanting to do this in a text box object?

For text box:

=FirstSortedValue(Measure, -Date) - FirstSortedValue(Measure, -Date, 2)

Capture.PNG

For straight table:

=Sum(Measure) - Above(Sum(Measure))

Capture.PNG

ali_hijazi
Partner - Master II
Partner - Master II

I would suggest that you add two list boxes to select dates

but you have to give the list boxes alternate states say State1 and State2

on your chart or text object you would write:

sum({State1}Measure) - sum({State2}Measure)

I can walk on water when it freezes
saviostrazzullo
Contributor III
Contributor III
Author

Sunny thank you for your time.

Maybe I had to add more informations, my ask was not complete. I am using Qlik Sense and I use the function Sum(Measure) - Below(Sum(Measure)) in a Bar Chart. I have two dimensions: Company and Date and  one measure = Sum(Measure) - Below(Sum(Measure)). The bar chart show me the Companies and the differences but I can't order them in the sorting parameters because I have two dimensions and the first is Company. I can't put the measure as first sort field. I can use other objects and functions, I would like to have the difference beetwen the two selected date ordered by Company with most first. I hope I had been more clear. Thank you. Savio

saviostrazzullo
Contributor III
Contributor III
Author

Hi thank you for your time.

I don't know I can use state in Qlik Sense.

Maybe I had to add more informations, my ask was not complete. I am using Qlik Sense and I use the function Sum(Measure) - Below(Sum(Measure)) in a Bar Chart. I have two dimensions: Company and Date and  one measure = Sum(Measure) - Below(Sum(Measure)). The bar chart show me the Companies and the differences but I can't order them in the sorting parameters because I have two dimensions and the first is Company. I can't put the measure as first sort field. I can use other objects and functions, I would like to have the difference beetwen the two selected date ordered by Company with most first. I hope I had been more clear. Thank you. Savio