Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Akina0929
Creator
Creator

How to get Recent months sale for every country?

I have the data like following

Date

Country

Sales

1/2/2019

IND

5

2/3/2019

USA

21

3/4/2019

JAPAN

56

1/5/2019

NW

45

4/6/2019

PAK

33

1/7/2019

IND

11

2/9/2019

USA

33

2/10/2019

JAPAN

50

8/10/2019

JAPAN

54

 

please suggest me to get recent month sales for every country.

Thanks,

Anji.

 

 

Labels (1)
  • hi

2 Replies
sunny_talwar

Assuming you have a Month field like this or something similar created in the script

MonthName(Date) as MonthYear;

you can try this

Max MonthYear

=MaxString(MonthYear)

Sales for Max MonthYear

=FirstSortedValue(Aggr(Sum(Sales), Country, MonthYear), -Aggr(MonthYear, Country, MonthYear))

 

Brett_Bleess
Former Employee
Former Employee

Anji, did Sunny's post and example app get you what you needed?  If so, be sure to come back to the thread and use the Accept as Solution button on his post to give him credit and let others know it did work.  If you still need further help, leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.