Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
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?

1 Solution

Accepted Solutions
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

View solution in original post

33 Replies
luismadriz
Specialist
Specialist

Hi,

This is a wild guess

=AGGR(ONLY({<CALENDAR_YEAR_MONTH_CD={"=$(=Max({1} CALENDAR_YEAR_MONTH_CD))"}>} CALENDAR_YEAR_MONTH_CD), CALENDAR_YEAR_MONTH_CD)

Cheers,

Luis

bharani8
Creator III
Creator III
Author

No... When i apply the expression that i had mentioned .. i see Month's column in a List box... In that List box i want the max month to be selected by Default while opening the document..

luismadriz
Specialist
Specialist

Hi,

Sorry, I misread your issue. I've never done it but found the following for Qlikview

Default Selection in Qlikview

I hope this helps,

Cheers,

Luis

Anil_Babu_Samineni

What is your Month Field here?

Can you test this for a while =Max(MonthField)

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

Hi Anil - I have created the below expression(For Month field) to achieve the Biz logic ... Now i see the Months after the below Expression is applied... Requirement is Now i need the max Month to be selected from this expreesion while opening the document..

=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))))

Anonymous
Not applicable

try this way .. add an action on open --> select in field -->Date field --> in the string --> use your your calculation that has been used for calculated dimension.

bharani8
Creator III
Creator III
Author

Since this is calculated one.. We dont have any specific name for this.. That is the challenge i face now..

bharani8
Creator III
Creator III
Author

Anil - Is there a way of converting this to variable and calling the max of Variable while opening the document ?

Anonymous
Not applicable

Yes I agree bharani, the calculated field is based on YDAY which is a date, so I believe that shud be your field to use

I have this =max(if(Date>'08/01/2015' and Date<'04/15/2017',Date))  in on open action its working my original Date has some thousand dates but I took the range I wanted and calculated it .. its working...