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 flag | Year | Month | Country | Sales |
1 | 2019 | India | 100 | |
1 | 2019 | USA | 150 | |
1 | 2018 | India | 200 | |
1 | 2018 | USA | 250 | |
1 | 2017 | India | 300 | |
1 | 2017 | USA | 150 | |
1 | 2016 | India | 500 | |
1 | 2016 | USA | 250 | |
0 | 2019 | Jan 2019 | India | 450 |
0 | 2018 | Jan 2018 | USA | 140 |
0 | 2017 | Jan 2017 | India | 150 |
0 | 2016 | Jan 2016 | USA | 120 |
0 | 2019 | Feb 2019 | India | 150 |
0 | 2018 | Feb 2018 | USA | 230 |
0 | 2017 | Feb 2017 | India | 300 |
0 | 2016 | Feb 2016 | USA | 300 |
0 | 2019 | Mar 2019 | India | 300 |
0 | 2018 | Mar 2018 | USA | 500 |
0 | 2017 | Mar 2017 | India | 1000 |
0 | 2016 | Mar 2016 | USA | 4000 |
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
Country | MaxYearSelected | Sales Percent |
India | 2018 | 44% |
USA | 2018 | 62.5% |
Please explain the formula for the % calculation