Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have data like
Country,per,sum(sales)
US,10%,5000
UK,7%,8000
IN,12%,9000
AUST,6%,7100
.........,7%.8000
....,6%,8700
....,4%,7600
like this now I want to if the country is Us i need to 10% to sum(sales).
if the country is UK 7%
How we can Do this without if.
Hi @Kalyani22,
To apply different percentages to the sum of sales for different countries, U can use a mapping table and the ApplyMap function.
Create a Mapping Table:
CountryPercentageMap:
MAPPING LOAD * INLINE [
Country, Percentage
US, 0.10
UK, 0.07
IN, 0.12
AUST, 0.06
];
Apply the Mapping Table:
LOAD
Country,
[sum(sales)],
[sum(sales)] * ApplyMap('CountryPercentageMap', Country, 0) AS AdjustedSales
FROM DataSource;
***Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.***