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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Prabhu
Creator
Creator

Select the field on open is not working properly

Hi all,

I want last month to be selected on opening the document. i also have other fields to be selected on opening the document.

Other field selections are working properly.But, last month is not selected because there is no data for last month for the selection of other fields.

I want to set last month selection as priority.

Below is the expression i am using. MonthYear =if(DATE(Max(date#(MonthYear,'MMM-YYYY')), 'MMM-YYYY')=month(TODAY()) & '-' &year(today()), DATE(Max(date#(MonthYear,'MMM-YYYY'))-1, 'MMM-YYYY'), DATE(Max(date#(MonthYear,'MMM-YYYY')), 'MMM-YYYY'))

stalwar1

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

What exactly are you testing here? May be this

=If(MonthStart(Max({1} MonthYear)) = MonthStart(Today()),

     Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'),

     Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

I guess you are using Select in Field trigger on MonthYear field, right... try this as the search string


=Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY')

Prabhu
Creator
Creator
Author

Hi Sunny,

Thanks for quick response. In my case,i am going to use the below expression for field trigger. Please correct me if am wrong.

=if(Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY')=month(TODAY()) & '-' &year(today()), Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'), Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))

@stalwar1

sunny_talwar
MVP
MVP

What exactly are you testing here? May be this

=If(MonthStart(Max({1} MonthYear)) = MonthStart(Today()),

     Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'),

     Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))