Hi Team,
Issue Summary: I am migrating a complex calculation from Tableau to QuickSight and am struggling to replicate the results of a nested FIXED LOD. The calculation involves a ratio where the denominator requires two levels of “fixed” aggregation: first finding a MAX at the Account level, then summing those results at a higher grouping level.
Tableau Logic:
{ FIXED [CDM],[Product Type] : SUM([qty]) }
/
{ FIXED [CDM],[Product Type], [Time Period Filter] : SUM({ FIXED [Account], [Product Type] : MAX([iol_consignment]) }) }
Product Type Calculation:
IF [qty] > 0 or [iol_consignment] > 0 then [modified_desc] END
Time Period Filter Calculation:
CASE [Time Period]
*WHEN 1 THEN*
*\[dt_ic\] >= DATETRUNC('year', \[Max Dt Period\])*
*AND \[dt_ic\] <= \[Max Dt Period\]*
*WHEN 2 THEN*
*DATEPART('month', \[dt_ic\]) = DATEPART('month', \[Max Dt Period\])*
*AND DATEPART('year', \[dt_ic\]) = DATEPART('year', \[Max Dt Period\])*
*AND \[dt_ic\] <= \[Max Dt Period\]*
*WHEN 3 THEN*
*DATEPART('month', \[dt_ic\]) = DATEPART('month', DATEADD('month', -1, \[Max Dt Period\]))*
*AND DATEPART('year', \[dt_ic\]) = DATEPART('year', DATEADD('month', -1, \[Max Dt Period\]))*
*WHEN 4 THEN*
*\[dt_ic\] >= DATEADD('month', -11, \[Max Dt Period\])*
*AND \[dt_ic\] <= \[Max Dt Period\]*
*ELSE FALSE*
END
QuickSight Attempt -1:
sumOver(qty, [CDM, {Product Type}], PRE_FILTER)
/
sumOver(maxOver({iol_consignment}, [Account, {Product Type}], PRE_FILTER), [CDM, {Product Type}, {Time Period Filter}], PRE_FILTER)
QuickSight Attempt -2:
sumOver(qty, [CDM, {Product Type}], PRE_AGG)
/
sumOver(maxOver({iol_consignment}, [Account, {Product Type}], PRE_FILTER), [CDM, {Product Type}, {Time Period Filter}], PRE_AGG)
QuickSight Attempt -3:
Numerator:(getting closer values when taken for each Account)
sumOver(qty, [CDM, {Product Type}],PRE_FILTER)
QuickSight Attempt -4:
Denominator :
sumOver(max({iol_consignment}), [Account, {Product Type},CDM, {Time Period Filter}])
QuickSight Attempt -5:
Denominator 1
maxOver({iol_consignment1},[Account,{Product Type}],PRE_FILTER)
Denominator 2:
sumOver({Denominator 1},[Account, CDM,{Product Type}],PRE_FILTER)
Final Division:
min({Div Uti num})/min({Denominator 2})
Not able to replicate the exact nested LOD logic from Tableau in QuickSight, could someone guide me on the correct LAC-A nesting ?
WLS-Luis