Qlik Community

Qlik Sense App Development

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

Valued Contributor III

Getting Current Month and Year & Previous Month and Year QlikSense


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)