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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rangesum with two Dimensions

Hi.

I´m having a problem with a Rangesum expression and need your help.

I´ve got a pivot table with two Dimensions, Month and Day. Then I´ve got in the expressions my Sales , Sales LAst year, and then my problem appears... I need to have a YTD, that gives me accumulated values for Month and Day when I expand my Day dimension is expanded. That´s when I cannot see what I wish. My Values for YTD Month are fine, and for Accumulated Day granularity are also fine, but with January expanded (or another Month), the other Months do not accumulate, giving me just the Sales for each Month by it self.

I´m using this expression:

=RangeSum(Alt(Above(TOTAL [myexpressionName]), 0), rangesum(above(sum({$<Year={2013}>} (A - B - C)),0)))

My Sales expression is a Calculated sum of A - B - C

Reminding that My Values are fine when Day is not expanded;

My Accumulated Days Values are also fine;

Only my Months that are NOT expanded, that doesn´t Accumulate, giving me just each Month Total.

I´ve tried to Start the expression with Sum(Aggr(...)), but that mess with my values and does not give me what I need.

Thanks in Advance!

Best Regards,

Bruno Silva.

14 Replies
jolivares
Specialist
Specialist

I just simple export your data to excel and re-import to QV, that's it!!!

I really do that to assure that the data is correct and don't have a missing ones.

Not applicable
Author

In fact, your example works just fine (That´s why I marked it as Correct Answer), however when deploy it to my data, the first two rows are messed up... First Row (Jan) shows Jan and Feb sum, the second row (Feb) shows just Feb, after that it´s all fine. This continues even when Day Dimension is expanded.  All days are fine, but sub-totals(with January expanded) show Jan + Feb, then Feb (witch is collapsed) stays showing just Feb, after that all values are fine!

jolivares
Specialist
Specialist

I think that your data has some trouble, try to purge it. 

Maybe you can export your data to an excel file or a txt and reload.  See what happens.

Where that data come from?  Try to post raw data in order I can see it.

Not applicable
Author

Hi Juan.

Here is the Excel File, with non aggregated Dummy Data as it comes from client (I cannot send original Data, so I put "1" in every field). I don´t think that there is any problem with the data. It´s just a Date, and 3 fields, where the calculations will be A-B-C in this case.

I´ve tried to aggregate it in Script, doing "Sum(A-B-C) as Sales (...) group by Date", and also tried in formula, (A-B-C), substituting "Sales". Always shows it as I said it above. Wrong values in Jan, and Feb...

Dummy Data: DummyData.xlsx

Best Regards,

BS.

Not applicable
Author

Just Solved it!

You were right! It was a misplaced value that was messing the data! As I put it in the right date order, the error was gone... Finally!

Thank you very much for your help, time and patience!

Best Regards,

BS.