# New to Qlik Sense

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

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

## Set analysis Period of dates data in a table

Hi,

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

Labels (7)

• ### Variables

2 Replies
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)

//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);

COUNT({<YourDateField = {">\$(vPastMonth) < \$(vCurrentMonth)"}>} YourField)``````

Just change the fields on the expression.

Let me know if it works.

Specialist II

@flyhigh15  I have used the below expression: