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
sunny_talwar

I saw that... and I am glad it did

varunreddy
Creator III
Creator III
Author

Hi Sunny,

I got another issue. I am trying to add new field Rule. I have added the source file to the original discussion. Can you please help?

I am expecting this:

   

DateCDERuleDQ DimesnionTotalFailedRollingSum
4/30/2017CDE1Rule1_CCompleteness28,0002500025000
4/30/2017CDE1Rule1_VValidity28,000100026000
4/30/2017CDE1Rule1_AAccuracy28,00050026500
4/30/2017CDE2Rule1Completeness28,0002500025000
4/30/2017CDE2Rule2Validity28,000100026000
4/30/2017CDE2Rule3Accuracy28,00050026500
4/30/2017CDE3C_Rule1Completeness28,0002500025000
4/30/2017CDE3V_Rule2Validity28,000100026000
4/30/2017CDE3A_Rule3Accuracy28,00050026500
sunny_talwar

checking..

sunny_talwar

Have you attached an Excel file or qvw?

varunreddy
Creator III
Creator III
Author

Excel. I now added QVW

sunny_talwar

You can try this

Aggr(RangeSum(Above(Sum({<[DQ Dimesnion],Rule>}Failed),0,RowNo(TOTAL))), Date, CDE, [DQ Dimesnion])

but this will depend on the sorting of your DQ Dimesnion field in the script. So, although it works in the sample, it may or may not work for your case

Capture.PNG

varunreddy
Creator III
Creator III
Author

Perfect

Many Thanks,

Varun

sunny_talwar

Remember this may or may not work for your actual issue because of the sorting issue....

varunreddy
Creator III
Creator III
Author

Do you mean filtering of dimension?

sunny_talwar

No that's not what I meant.... Aggr() function depends on the load order of your field... Since we are doing a RangeSum within a Aggr(), the load order of your field DQ Dimension will determine how the chart will accumulate.