Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Set analysis Period of dates data in a table


I have a requirement to show data for a period from last month  of 15 date to current  month  of 16 date  for a table in qliksense


#setanalysis #Qliksense

2 Replies
Contributor III
Contributor III

Hi Flyhigh,

I solved this by creating some variables that gets me the dates i want and them using them as a parameter in the Set Analysis.

check the code below:


//Get the year from last month (Case it's on january it will not break) 
LET vYearLastMonth = Year(AddMonths(Today(),-1));

//Get Current Year
LET vYear = Year(Today());

//Concatenate the day (Fixed Value) with the month number from last month and concatenating the year, thus we have 15/08/2022.
LET vPastMonth 	  = '15/' & RIGHT(0 & Num(Month(AddMonths(Today(),-1))),2) & '/' & $(vYearLastMonth);

//Concatenate the day (Fixed Value) with the month number from Current month and concatenating the year, thus we have 16/09/2022.
LET vCurrentMonth = '16/' & RIGHT(0 & Num(Month(Today())),2) & '/' & $(vYear);

//On your Expression use: 
COUNT({<YourDateField = {">$(vPastMonth) < $(vCurrentMonth)"}>} YourField)


Just change the fields on the expression.

Let me know if it works. 

Specialist II
Specialist II

@flyhigh15  I have used the below expression:


Please let me know if this worked for you.

If yes,please like and accept it as a solution.