
2. Re: Gross margin driver analysis  Calculation with aggregate and nonaggregate
An Nguyen Nov 30, 2017 5:21 AM (in response to Zhouyi Zhang)Hi Zhouji,
"CY period net sales" is not an aggregate one, as it is the result of "IF" function. I need to use "CY period NS/kg" or "CY period cogs/kg", and multiply with (unit*size), and Tableau could not execute the formula.
An

3. Re: Gross margin driver analysis  Calculation with aggregate and nonaggregate
Zhouyi Zhang Nov 30, 2017 5:57 AM (in response to An Nguyen)Hi, A Nguyen
Try this
1{ FIXED :[CY period NS/kg]}*[Size (kg)]*[Units]/{ FIXED :SUM([PY period net sales])}
ZZ

4. Re: Gross margin driver analysis  Calculation with aggregate and nonaggregate
An Nguyen Nov 30, 2017 6:42 AM (in response to Zhouyi Zhang)Thanks Zhouji for your effort. However, the {FIXED: [CY Period cogs/kg]} does not work well, as each product has different average cost, and cannot use the same data for the whole dataset.
An

5. Re: Gross margin driver analysis  Calculation with aggregate and nonaggregate
Zhouyi Zhang Dec 10, 2017 9:46 PM (in response to An Nguyen)Hi, An
I didn't see any column/field related to product, but if it exists in your real data, then you can try
1{ FIXED [product] :[CY period NS/kg]}*[Size (kg)]*[Units]/{ FIXED [product] :SUM([PY period net sales])}
Hope this could help
ZZ