Hello,
What calculation on discount you would like to do for Discount measure. As i understand, the problem is that you have Sum as an aggregation at the Discount level. It's better you choose Average there. This way you get to see the average discount at product level.
Does that help?
Regards,
Ashutosh
Thanks for your answer Ashutosh Rastogi. As you say I have a SUM aggregation for the DiscoutPercentage. If I choose Average instead it helps reduce the error presented, but I don't get the correct numbers. This is quiete a simple and common treatment of data, to lookup for reference prices or interest rates for a product, then make the calculation, and then get the sumarized results. But it seems not to be simple at all in Lumira.
To explain better with a small data data set I'm attaching an image with the problem.
All I have as hard facts in data are the green columns: Quantity, ProductPrice and DiscountPercentage). I have to present Subtotal, Discount, and TotalSales (yellow columns) information in the visualizations, as that are the interesting figures to analyse, so these yellow columns have to be calculations:
Subtotal = Quantity * ProductPrice
Discount = Subtotal * DiscountPercentage
TotalSale = Subtotal - Discount
In this dataset with 10 rows the desired results in the visualization for all the discounts, and all the sales should be $29,656.31 and $1,069,980.50 respectively.
If I use a SUM for Quantity I do get the 94 products sold. If I use an Average for ProductPrice I would get $8,875.69. Now the first calculation is Subtotal = Quantity * ProductPrice. Using the average ProductPrice I get a Subtotal of $834,314.86 which by now is already incorrect as the real Subtotal for all sales is $1,099,636.80. Furthermore, if I go on and use Averge for DiscountPercentage I get a 4.50%, and making the calculation of Discount = Subtotal * DiscountPercentage I get a very wrong $37,544.17 for a total discount amount, and calculating TotalSales = Subtotal - Discount I get also a wrong $796,770.69 for TotalSales instead of the correct $1,069,980.50.
So you can se my problem here. Is there any way in Lumira to make the calculations in any way, or with any parameters so that I can get the correct calculations? Or must I pre-process all my data with a DataIntegration tool to get all the information precalculated, so that Lumira just have to do sums to provided columns, and not calculate anything?
Add comment