Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Kalyani22
Contributor II
Contributor II

How to add different % to Different countries for sum(sales) in qlik

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.

 

Labels (1)
1 Reply
TauseefKhan
Creator III
Creator III

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.***