Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Above() or below() functions

Hi there

I want to create a chart as per the below, I have the user, date and the volume per day.

But in the MTD column I need to have 61+71 in row 2 for example.

In row 3 its the sum of 71+61+75 and so on.

Is this possible?

I have tried above and below functions but cannot seem to achieve this.

Thanks,

Aidan

   

User DateVolumeTotal MTD
User 101/11/20157171
User 102/11/201561132
User 103/11/201575207
User 104/11/201556263
User 105/11/201555318
User 106/11/201574392
Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Try with

=RangeSum( Above( Sum(VolumeField), 0, RowNo() ))

View solution in original post

6 Replies
swuehl
Champion III
Champion III

Try with

=RangeSum( Above( Sum(VolumeField), 0, RowNo() ))

sunny_talwar
MVP
MVP

Or may be this:

=RangeSum(Above(TOTAL Sum(VolumeField), 0, RowNo(TOTAL)))

Not applicable
Author

Hi Sunny

That's great, only thing is if I wanted it to reset at each new row fro example below;

UserDateVolumeTotal MTD
User 101/11/20157171
User 102/11/201561132
User 103/11/201575207
User 104/11/201556263
User 105/11/201555318
User 106/11/201574392
User 201/11/20154040

Thanks again for your help

AIdan

Anonymous
Not applicable
Author

Hi,

you can use the following expression in your query:

LOAD ...

[Volume] + if(isnull(Peek(acc_volume, -1)), 0, Peek(acc_volume, -1)) as acc_volume

from ...;

swuehl
Champion III
Champion III

That's why I left out the TOTAL qualifier.

Not applicable
Author

Perfect thank you