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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
maxloveiii
Contributor III
Contributor III

How to use max yearmonth in Set Analysis

Hi, Experts

How can I use my first expression value (Max of nYearmonth of each Item)  in set analysis of second expression. Item 31-KT-0-0007 result is correct but Item 31-KT-0-0006 isn't correct because max of nYearmonth is 202006 instead of 202004

Thanks in advance

Max

Qlik.PNG

 
 
 
 
 
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be try this

FirstSortedValue(Aggr(Sum({<MonthEnd = {1}, Year, Month, Date>}BalQty), [Item Code], [nYearMonth]), -Aggr([nYearMonth], [Item Code], [nYearMonth]), 2)

View solution in original post

3 Replies
Steven_Haught
Creator III
Creator III

You need to have double quotes "" surrounding the set expression, instead of the single quotes,  in the set expression. It acts like a search function with your $ expansion. 

sunny_talwar
MVP
MVP

May be try this

FirstSortedValue(Aggr(Sum({<MonthEnd = {1}, Year, Month, Date>}BalQty), [Item Code], [nYearMonth]), -Aggr([nYearMonth], [Item Code], [nYearMonth]), 2)
maxloveiii
Contributor III
Contributor III
Author

Thanks Sunny_talwar 

It work great!

maxloveiii_0-1596797201358.png