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: 
varunreddy
Creator III
Creator III

Range Sum

Hi All,

I am trying to calculate the sum using the prior number which is aggregated by CDE and DimensionA.

Now I am trying to calculate cumulative observations, which is

A Completeness 25000

A Validity           26000 (25000+1000)

A Accuracy        26500.(25000+1000+500)

I got this using the expression:

RangeSum(Above(Total aggr(sum([Ruleset Failing Records]),[Associated DQ Dimension]CDE Name]),0,RowNo()) .

When I select Accuracy I get 500, instead of 26500.

Can anyone cme across this situation?

Thanks in advance!

Message was edited by: Varun Reddy

45 Replies
varunreddy
Creator III
Creator III
Author

Hi Sunny,

What are you multiplying by Avg(1)?

sunny_talwar

Avg(1) will equal 1 for in selections and 0 for out of selection rows. So, although we ignore selection in [DQ Dimesnion] we only see those rows which are selected using Avg(1)

varunreddy
Creator III
Creator III
Author

Got it, thanks

varunreddy
Creator III
Creator III
Author

Hi Sunny,

I am now trying to add Date field in the dimension. If I add Date field the Rangesum is not working. Can you please help.

The date I am using was 4/1/2017.

Expression Used:

RangeSum(Above(Sum({<Dimension, Date= {'$(vDate)'}>}Failed),0,RowNo()))*Avg(1)

sunny_talwar

You will have to play around with the sorting... I am not sure what you desired output is so would be difficult to suggest anything, but try sorting by first Date and then DQ Dimension if you will restart accumulating for each date.

varunreddy
Creator III
Creator III
Author

Sunny,

I was trying to Roll up Failed Records. I would like to see this:

Date          CDE       Dimension      Total       Failed    Rolling Sum

4/1/2017  CDE1  Completeness   28000      25000      25000

4/1/2017  CDE1   Validity               28000      1000        26000

4/1/2017  CDE1   Accuracy            28000       500        26500

But, I see this

Date        CDE       Dimension      Total       Failed    Rolling Sum

4/1/2017  CDE1  Completeness   28000      25000      25000

4/1/2017  CDE1   Validity             28000      1000        1000

4/1/2017  CDE1   Accuracy          28000       500        500

sunny_talwar

Can you post a qvw sample?

Anil_Babu_Samineni

Seems, the same here Re: Rangesum with multiple dimensions

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Super... thanks for taking care of this Anil

varunreddy
Creator III
Creator III
Author

Sunny, this issue is now resolved.

Thanks,

Varun