Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
izmingazov
New Contributor III

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

Re: Displaying only selected range for cumulative total

Try this

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

View solution in original post

4 Replies

Re: Displaying only selected range for cumulative total

Try this

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

View solution in original post

izmingazov
New Contributor III

Re: Displaying only selected range for cumulative total

Thank you, that was helpful:

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

but I still don't understand how it works

Re: Displaying only selected range for cumulative total

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

izmingazov
New Contributor III

Re: Displaying only selected range for cumulative total

Now much clearer for me. Thank you!