Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
varunreddy
Creator III
Creator III

Rangesum with multiple dimensions

Hi All,

I  am new to the RangeSum. I am trying to do the rolling sum with "Failed" records with multiple dimensions. I see that rangesum functionality is not working. I am attaching the Source file and the QVW.

Thanks in advance!

Cheers,

VK

Message was edited by: Varun Reddy

1 Solution

Accepted Solutions
Anil_Babu_Samineni

This?

RangeSum(Above( Sum({<Date= {'$(=vDate)'}>}Failed),0,RowNo(TOTAL)))

Capture.PNG

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

View solution in original post

14 Replies
Anil_Babu_Samineni

Where this is not working? Can you describe little more

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

Hi Anil,

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

Anil_Babu_Samineni

Then try this?

Aggr(Rangesum(Below(Sum(Failed),0),Above(Failed,1,RowNo(TOTAL))),Dimension)

OR

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

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

Anil,

First isn't working.

Second is working but if we have multiple CDE's (i.e. CDE1 and CDE2) for same date, then it is not showing second CDE.

In the below scenario, we get this:

4/1/2017  Completeness CDE1  50000

4/1/2017  Validity           CDE1   52000

4/1/2017   Accuracy       CDE1   53000

Instead of:

4/1/2017  Completeness CDE1  25000

4/1/2017  Validity           CDE1   26000

4/1/2017   Accuracy       CDE1   26500

4/1/2017  Completeness CDE2   25000

4/1/2017  Validity           CDE2   26000

4/1/2017   Accuracy       CDE2   26500.

If I aggregate with CDE and Dimension, then we get

4/1/2017  Completeness CDE1  25000

4/1/2017  Validity           CDE1   1000

4/1/2017   Accuracy       CDE1   500

4/1/2017  Completeness CDE2   25000

4/1/2017  Validity           CDE2   1000

4/1/2017   Accuracy       CDE2   500.

   

4/1/2017CompletenessCDE12800025000BCBSUSRule1_C
4/1/2017ValidityCDE1280001000BCBSUSRule1_V
4/1/2017AccuracyCDE128000500BCBSUSRule1_A
4/1/2017CompletenessCDE22800025000BCBSUSRule2_C
4/1/2017ValidityCDE2280001000BCBSUSRule2_V
4/1/2017AccuracyCDE228000500BCBSUS

Rule2_A

I

Anil_Babu_Samineni

Seems, 1st one also working to me

Capture.PNG

Capture.PNG

And for your question, you have to aggregate each together like below

Aggr(RangeSum(Above(Sum({<Dimension, Date= {'$(=vDate)'}>}Failed),0,RowNo())), Dimension, CDE)

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

Using first expression:

 

DateCDEDimensionAggr(Rangesum(Below(Sum(Failed),0),Above(Failed,1,RowNo(TOTAL))),Dimension)
-
4/1/2017CDE1Completeness75000
4/1/2017CDE1Validity28000
4/1/2017CDE1Accuracy27500

Using Second Expression:

 

DateCDEDimensionAggr(RangeSum(Above(Sum({<Dimension, Date= {'4/1/2017'}>}Failed),0,RowNo())), Dimension, CDE)
-
4/1/2017CDE1Completeness25000
4/1/2017CDE1Validity1000
4/1/2017CDE1Accuracy500
4/1/2017CDE2Completeness50000
4/1/2017CDE2Validity2000
4/1/2017CDE2Accuracy1000

DataSource:

4/1/2017CompletenessCDE12800025000BCBSUSRule1_C
4/1/2017ValidityCDE1280001000BCBSUSRule1_V
4/1/2017AccuracyCDE128000500BCBSUSRule1_A
4/1/2017CompletenessCDE22800025000BCBSUSRule2_C
4/1/2017ValidityCDE2280001000BCBSUSRule2_V
4/1/2017AccuracyCDE228000500BCBSUS

Rule2_A

varunreddy
Creator III
Creator III
Author

Previous data set has one CDE, but this set of data is having two CDE's for same date

Anil_Babu_Samineni

Please share the data which you are using like

Date, CDE, Dimension, Failed

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

Attached the Source file to the Original discussion. Please take a look