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: 
vardhancse
Specialist III
Specialist III

Getting Current Month and Year & Previous Month and Year QlikSense

Hi,

I have one requirement like:

1. By default "previous-month" and "current-year" should be taken in expression

2. On top of Month and Year selections, expression should calculate for "previous month" and "current year"

For an instance:

a. if we select January and 2019, previous month should be December and Year should be 2018

b. If we select February and 2019, previous month should be January and Year should be 2019

Created 2 variables like:

vLatestMonth: IF(GetSelectedCount(MonthName)=0,Month(Date(AddMonths(Today(),-1),MonthNames)),MonthName)

vLatestYear: IF(GetSelectedCount(Year)=0,Year(Today()),Year)

 

Labels (2)
0 Replies