Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rammarthi
Creator
Creator

How to get the percentage of sales by state for latest year.

Hi,

I have a data set which is the result of a combination of yearly data and monthly data. I have a flag variable and indicator field with 1 and 0 to distinguish them. 

The data is like this:

Time flagYearMonthCountrySales
12019 

India

100
12019 USA150
12018 

India

200
12018 USA250
12017 India300
12017 USA150
12016 India500
12016 USA250
02019Jan 2019India450
02018Jan 2018USA140
02017Jan 2017

India

150
02016Jan 2016USA120
02019Feb 2019India150
02018Feb 2018USA230
02017Feb 2017India300
02016Feb 2016USA300
02019Mar 2019India300
02018Mar 2018USA500
02017Mar 2017

India

1000
02016Mar 2016USA4000

 

Out of this data I want to see for the maximum of the Year/ Month from selected data. Say If I select 2018,2017 and 2016 then the below table should only be displayed for the Year/ Month

CountryMaxYearSelectedSales Percent
India201844%
USA201862.5%
Labels (1)
2 Replies
johnca
Specialist
Specialist

What you are asking for isn't clear with the information provided. How did you come up with the lower table where India in 2018 was 44% and the USA 62.5%? Do you have an equivalent Excel file, or?
qliksus
Specialist II
Specialist II

Please explain the formula for the % calculation