Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
try multiplying the EXPRESION WITH
avg({<Year={2015,2016,2017,2018}>}1) // you can changes your field accordingly
Edit: Please don't make the year static and use some expression to make this dynamic.
change ur Measure from:
Rangesum(Above(
sum(In-Out)
,0,rowno()))
to :
Aggr( {<YourDateDimension>}
Rangesum(Above(
sum(In-Out)
,0,rowno()))
,YourDateDimension)
Result per analogy:
With no selection:
Now I select from week 35 (128.88M)
If u want to ONLY SELECT WEEK 35 and get all the data since 35:
sum({<YourDateDimension={">=$(=min(YourDateDimension))"}>}aggr({<YourDateDimension>}
RangeSum(above(
Sum({<YourDateDimension>}In-Out)
,0,RowNo()))
,YourDateDimension))
It's never a good idea to build static expressions Pradosh
Please see my reply, I think that's what he wants to achieve.
Hi OmarBenSalem,
Thank you for your contribution. I applied your solution as follows and experienced a strange effect on my graph. Do you know how to resolve this? I have a feeling it may be something to do with the Aggr function?
Can u please uncheck continous axis under the x-axis tab and select only the last month u have so that we could see what had happened?
I have a day by day axis so I am looking to show the continuous aspect in my chart, however I have filtered to just one month, January 2017, to check it out. It seems this aggregation is increasing the raw data values markedly (see screenshot) as no data points in this month reach 1.7m, so I think perhaps I'm basing it incorrectly
Reattach the same image with data points checked with the values (under presentation tab)
and add a new line chart with ur basic measure:
sum(In-Out)
I want to compare the 2 to see what the rangesum does