Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sakshamkaul
Creator II
Creator II

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.

sakshamkaul
Creator II
Creator II
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

sakshamkaul
Creator II
Creator II
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