Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Displaying only selected range for cumulative total

Hi,

Can anybody help me or guide with the following problem.

I have a simple bar chart with month-year dimension and expression displaying cumulative total like:


     =RangeSum(Above(Count(DISTINCT {$<%DateType={'SpecialDate'}>}  %UniqueID), 0, RowNo()))

When I make selection in the month-year pane cumulative total is recalculated. It is correct. But i want to know is it possible to calculate the cumulative data regardless of the month-year (over full set of all the records), but display only selected range? So if i select 3 months (august 2017 - october 2017) there are only 3 values (39, 51, 60) should be represented:


1.png

1 Solution

Accepted Solutions
sunny_talwar

Try this

=RangeSum(Above(Count(DISTINCT {$<%DateType={'SpecialDate'}, MonthYear>}  %UniqueID), 0, RowNo())) * Avg( {$<%DateType={'SpecialDate'}>} 1)

View solution in original post

4 Replies
sunny_talwar

Try this

=RangeSum(Above(Count(DISTINCT {$<%DateType={'SpecialDate'}, MonthYear>}  %UniqueID), 0, RowNo())) * Avg( {$<%DateType={'SpecialDate'}>} 1)

Anonymous
Not applicable
Author

Thank you, that was helpful:

* Avg({<Дата = {">=$(=$(vStartDateNum))<=$(=$(vEndDateNum))"}>} 1)

but I still don't understand how it works

sunny_talwar

Basically within the rangesum expression... we ignore selection in MonthYear field... which forces it to show everything regardless of selection... but we use Avg(1) to show only those MonthYear... which have been selected... as Avg(1) = 1 for selections and Avg(1) = 0 for out of selection.... So, you accumulation is still intact, but you are just showing the selected MonthYears

Anonymous
Not applicable
Author

Now much clearer for me. Thank you!