Skip to main content
Announcements
Applications are open for the 2024 Qlik Luminary Program. Apply by December 15 here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nlee1993
Contributor III
Contributor III

Line chart measure dependent on dimension

Hi Qlik Community,


I have created a line chart, with dates on the x-axis and a rangesum for a stock level on the y-axis. The stock is the sum of the stock since "the beginning of time" (2007 ish in my case), however I only want to show on my chart 2015 onwards. When I filter to show only 2015 onwards, the measure recalculates the sum since the new beginning of time (my 2015 filter) and the values change. 

Does any one know how to de-couple the measure from the dimension, in a way that will preserve a range sum since the beginning of the data set, when filtering my dimension?

chrome_2019-01-30_09-12-48.pngchrome_2019-01-30_09-13-25.pngchrome_2019-01-30_09-13-40.pngchrome_2019-01-30_09-13-57.png

 

Labels (7)
16 Replies
nlee1993
Contributor III
Contributor III
Author

Hi Pradosh, Thank you for your contribution. I applied the formula and it shows the data as I would like it, however as I think you've alluded to, I can't select other dates greater than 2015, when using 2015,2016,2017,2018 in the AVG(). A solution would be to make the date a variable? Do you know how to do this? Cheers

nlee1993
Contributor III
Contributor III
Author

So on the sum(in-out) chart we just have the values from those days, where as the rangesum is aggregating my values since all time. The values in the sum(in-out) chart are too small to cause the leaps in the aggr rangesum chart
chrome_2019-01-30_10-27-49.png

OmarBenSalem

Select the first Month u have...

nlee1993
Contributor III
Contributor III
Author

chrome_2019-01-30_10-37-34.png

OmarBenSalem

are u sure that u have no other selection made? other than the date field?

pradosh_thakur
Master II
Master II

Try this

use
if( rangesum( above ( sum(<[Transaction Date] > In-Out),0,rowno()) ) <0,
0, rangesum( above ( sum(<[Transaction Date] > In-Out),0,rowno()) )
) * avg(1)

check <Transaction Date> added instead of sum(In-out) inside the above function .

Then multiply the entire expression by avg(1)
Learning never stops.
nlee1993
Contributor III
Contributor III
Author

Hi Omar, correct, no other filters applied