Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
KishorePandurangan
Contributor II
Contributor II

Finding Max Week value on Selection of Month and Year for Specific Dimension value

Hi All,

I have requirement where i should be able to pick only the maximum weeks values on selection of a month/Year and only on one dimension field value in the chart.

I have explained it below,

Please help me in achieving it through the script or in front end. I mostly prefer it in the backend.

Requirement.PNG

I have also attached the sample file with data.

Thanks.

4 Replies
sunny_talwar

For Current Month (Feb), how are you getting Butter and Cookie = 120, but Milk = 40? Milk is related to Week 3 value, but Butter and Cookies are sum of Week 1, 2, and 3?

KishorePandurangan
Contributor II
Contributor II
Author

Yes, Milk should take only the Max week value of selected month(i.e week3 and value is 40), whereas butter and cookie should give sum of all three weeks that is 120

qliksus
Specialist II
Specialist II

Maybe something like the below 

sum({<product=-{"Milk"}>+<product={"Milk"},Yearmonth={$(=max(Yearmonth))},Weekno={$(=max(Weekno))}>}amount) 

Brett_Bleess
Former Employee
Former Employee

Kishore, did Qliksus' latest response get you what you needed?  If so, please be sure to return to the thread to close things out properly by using the Accept as Solution button on Qliksus' post, that will give them credit for the assistance and let other Members know it worked.  

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.