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, PercentageUS, 0.10UK, 0.07IN, 0.12AUST, 0.06];
Apply the Mapping Table:
LOADCountry,[sum(sales)],[sum(sales)] * ApplyMap('CountryPercentageMap', Country, 0) AS AdjustedSalesFROM DataSource;***Hope this resolve your issue.If the issue is solved please mark the answer with Accept as Solution & like it.***