Link to home
Start Free TrialLog in
Avatar of n_srikanth4
n_srikanth4Flag for India

asked on

Roll up is not aggregating measures.

Hi Team,

Requirement :   I want to roll up the measure values from Week-->to Month-->to Quarter-->to Year.

Issue : measure values are not rolling up.

Methodology Used (Method 1 in code attached) :

Used roll up function in sql server and pushing the aggregated values in to temp table(#) . Then pushing the values from temp table  in to respective physical tables based on the column values (Fiscal_Year/Fiscal_Month/Fiscal_Quarter/Fiscal_Week).

Reason to use this method :  
Underlying table( mba_related_sales_by_day ) has billions of records . Henceforth can't afford to do repeated aggregations from Year table  to Quarter table  to Month table  to week table  as this consume lot of time . In order to reduce the timelines of the ETL processing ,used this method.

Please find the attached code.

Please Note :
Method 1 : No performance issue , but not giving right results . Rollup is not working.
Method 2 : This method is not working for large data sets , has performance issues . But working for smaller data sets (1 calendar day).

Please correct my code(method 1) and help me  with the solution. Will appreciate your quick reply in this regard.

SQL_to_fix.sql

Thanks,
SRK.
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Only solution provided which answers the question as written.