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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bharani8
Creator III
Creator III

Getting max field (On calculated field) while opening the Document

Hi Experts,

Gm!

I have a calculated Month field and below is my expression..

=if((right(Date(if(YDAY=Aggr( NODISTINCT Max({<CALENDAR_YEAR_MONTH_CD = ,YDAY = ,Month_Name = , Year_Name =>}YDAY),Month_Name, Year_Name),YDAY),'MM/DD/YYYY'),4) &

     lEFT(Date(if(YDAY=Aggr( NODISTINCT Max({<CALENDAR_YEAR_MONTH_CD = ,YDAY = ,Month_Name = , Year_Name =>}YDAY),Month_Name, Year_Name),YDAY),'MM/DD/YYYY'),2)) = CALENDAR_YEAR_MONTH_CD,

MonthName((if(YDAY=Aggr( NODISTINCT Max({<CALENDAR_YEAR_MONTH_CD = ,YDAY = ,Month_Name = , Year_Name =>}YDAY),Month_Name, Year_Name),YDAY))))

I see all the Months (No Issues)... Now my requirement is ... While opening the document , i need the max Month in this list box to be selected by default.. How can I?

33 Replies
sunny_talwar

I have added static values, but you can change them as per need... but the main idea here is that you need trigger on 4 fields to get this done

1) CALENDAR_YEAR_MONTH_CD

2) Month_Name

3) Year_Name

4) YDAY

Anil_Babu_Samineni

Sunny, Are you really understand what her intend, Because i was trying to sort out myself but she/he needed in single expression. Can this Key useful for this case like my explanation here

I assume, You need to understand the business, Where and what we are going to have. Because, There is simple expression called long expression with multi fields. And you are going to have Default Selection trigger from Long and you don't know which field is that to be calculated. This is the case, i have 2 approaches

1) Create Key from all dimensions used for like (YDAY & MonthName & ....) as Field in your assignment of trigger

2) Create Primary key for that, If you have one primary key called any Seq. order / Date field try to test those field names as field of your trigger to get into with different field for 2 times ..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
bharani8
Creator III
Creator III
Author

Wowwwww!!! Super Sunny Gr8 thanks!

Yes it should not be static.. So i will try to set the max value for each field Will let u know if i face any issues..

bharani8
Creator III
Creator III
Author

Worked Perfectly!! Yahoooooo!!!