Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Year and Last month selection

Hello Friends,

I want the current year selection in callender and previous month selection.

So can any one tell me how to do this, as I have done for current year through sheet properties trigger but what about previous month selection how to give previous month selection.

Thanks,

Ashish

1 Solution

Accepted Solutions
crusader_
Partner
Partner

Hi,

Use below expression in search string:

=Month(AddMonths(today(),-1))

EDIT: Add new trigger to your existing Year selection which will select in field Month within above SearchString.

Regards,

Andrei

View solution in original post

7 Replies
crusader_
Partner
Partner

Hi,

Use below expression in search string:

=Month(AddMonths(today(),-1))

EDIT: Add new trigger to your existing Year selection which will select in field Month within above SearchString.

Regards,

Andrei

View solution in original post

Marcellino_Groothof
Contributor III
Contributor III

Hi,

Write in the script:

LET CY = year(today());

LET CM = month(today())-1;

then in a expressie: sum ({$<year={$(CY)},month={$(CM)},>} amount)

Regards

kavita25
Partner
Partner

Try the below expression for previous Month trigger.

Sheet properties >> On Activate Sheet >> Selection >> Select in Field >> Field- Date Field >> Search String

month(MonthStart(Max(Date_Field),-1))

Not applicable

Thank you, Kavita and Marcellino for your response but its not working with your exp.

n the correct ans is

=Month(AddMonths(today(),-1))

Not applicable

Thank you very much Andrei, for your response. its working with your exp.

kavita25
Partner
Partner

My expression was based on date field..

If you have date field and use the expression given by me, will surely work...

Not applicable

Ok sure...Thanx....