Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

List box set Analysis expression

Hi All,

I have a query that if i open my application by default current year, current month (starting from Jan till current month ) should be selected by default,Similarly i want day (starting from 1st till current day ) should be selected. I was able to manage current section using triggers but not the entire period. Please help for the same.

6 Replies
jaumecf23
Creator III
Creator III

You can use a trigger OnOpen. Use the Action "Select in field" with a formula like this :

='(' & concat(DISTINCT {<Day={"<=$(=max(Day))"}>} Day,'|') & ')'

rubenmarin

Hi Saksham, month values can be tricky but you can try with:

Year: =Max(YearField)

Month: ='<=' & Max(MonthField)

Day: ='<=' & Max({<Date={$(=Max(Date))}>} DayField)

Looking for the day of the max date because Max(DayField) can return always '31' if january is always selected at start.

Anonymous
Not applicable
Author

Day and Year are working fine but not  month. Please help paint1.png

ahmar811
Creator III
Creator III

Hi Saksham,

For month use below expression :

if your month field is string format use below code :

Month: ='('&Concat({<Year={$(=max(Year))}>}Month,'*|*')&')'


if your month field is Month Date format use below code :

Month: ='<=' & Max({<Year={$(=max(YearField))}>}MonthField)


I hope this will work for you.


Regards

Ahmar

Anonymous
Not applicable
Author

Do i have to use this expression in triggers?

ahmar811
Creator III
Creator III

Yes

Use in trigger,select your month field and put

='('&Concat({<Year={$(=max(Year))}>}Month,'*|*')&')'


expression

Regards

Ahmar