Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting page to default to max month

i would like my QlikView page to default to the maximum month. I have gone into sheet properties/ triggers/ Edit Action on activate sheet.

Selected select in field

Field = Month

Search String =max(Month)

Ok

OK

but this doesn't seem to work, I have saved the application open it and it is selecting the full year which is what we previously programmed it to do. Can anyone see what i am doing wrong/

THanks

4 Replies
vgutkovsky
Master II
Master II

Create a variable that contains the following formula and call it vMaxMonth:

max(aggr(Month,Month))
. I know this is somewhat convoluted, but it doesn't work to just say max(Month) for some reason.

Then create the following macro, which you can trigger on activate or whenever:


sub selectmaxmonth
inputVal = ActiveDocument.Variables("vMaxMonth").GetContent.String
ActiveDocument.Fields("Month").Select FormatDateTime(inputVal)
end sub


Regards,

Not applicable
Author

when you say create the following macro - where do i create it? in the script or is it in sheet properties/ triggers

Thanks

vgutkovsky
Master II
Master II

CTRL+M or Tools --> Edit Module.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


ATucker1 wrote:
Selected select in field
Field = Month
Search String =max(Month)


Try using maxstring() instead.

Search String =maxstring(Month)

-Rob