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: 
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 - Specialist
Partner - Specialist

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 - Specialist
Partner - Specialist

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

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 - Specialist
Partner - Specialist

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
Author

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
Author

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

kavita25
Partner - Specialist
Partner - Specialist

My expression was based on date field..

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

Not applicable
Author

Ok sure...Thanx....