Skip to main content

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
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