Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jamiemcc
Contributor III
Contributor III

Trying to create a cumulative chart in Sense

Hi Guys,

I am trying to Create a Cumulative graph based on weeks . 

My original Query is:

sum({<MARKET_NAME = {'English (US)'},Year = {'2019'} ,Quarter = {'Q4'}> }[Estimated Rating Time]/3600) 

 

When i Use the below  query it seems to be aggregating  the first two right but after that it seems to be using every value to Aggregate 

:

aggr(Rangesum( above(sum({<MARKET_NAME = {'English (US)'},Year = {'2019'} ,Quarter = {'Q4'}> }[Estimated Rating Time]/3600) ,0,RowNo())),Week)

 

Has anyone any ideas where my Mistake is?

 

Thanking you in advance?

 

Jamie

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

I think this should fix the issue

Aggr(
  RangeSum(Above(Sum({<MARKET_NAME = {'English (US)'}, Year = {'2019'}, Quarter = {'Q4'}>}[Estimated Rating Time]/3600), 0, RowNo()))
, (Week, (NUMERIC)))

or even this should be fine

RangeSum(Above(Sum({<MARKET_NAME = {'English (US)'}, Year = {'2019'}, Quarter = {'Q4'}>}[Estimated Rating Time]/3600), 0, RowNo()))

 

View solution in original post

4 Replies
sunny_talwar

"but after that it seems to be using every value to Aggregate".. can you explain this with an example please?

jamiemcc
Contributor III
Contributor III
Author

Hi

Please see attached Images.

On the Original Chart you can see a count for each week.

But on the cumulative chart it is not adding up correctly.

Have you any idea why.

it should go like

3.05k

7.11k

11.18k

16.84k

But it goes like

3.05k

7.11k

14.55k

20.21k

9.77k

Thanks,

Jamie

 
sunny_talwar

I think this should fix the issue

Aggr(
  RangeSum(Above(Sum({<MARKET_NAME = {'English (US)'}, Year = {'2019'}, Quarter = {'Q4'}>}[Estimated Rating Time]/3600), 0, RowNo()))
, (Week, (NUMERIC)))

or even this should be fine

RangeSum(Above(Sum({<MARKET_NAME = {'English (US)'}, Year = {'2019'}, Quarter = {'Q4'}>}[Estimated Rating Time]/3600), 0, RowNo()))

 

jamiemcc
Contributor III
Contributor III
Author

Thank you So much, This works.
Bravo 🙂