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: 
rittermd
Master
Master

Expression inside Set Analysis

I want to do a calculation (AVG) based on a date falling in a certain date range.

I tried something like this and this works. Attempted to calculate the metric for records that fall in the past 90 days.

=avg( {<CalendarDate={">=12/03/2017"}>} ($(vCheckinTime))*1440)

But I have to hard code the date that is 90 days ago. 

I tried to replace the hard coded date with today()-90 but I get no results.

Is this even possible in Set Analysis?  If it is what should the syntax be?

1 Solution

Accepted Solutions
OmarBenSalem

Let's assume that ur calendar date is recognized by qlik as a date and has a format as follow : DD/MM/YYYY

do sthing as follow:

avg({<CalendarDate={">=$(=date(today(1)-90,'DD/MM/YYYY'))"}>}urMeasure)

or (depends on what type of analysis u want, it maybe be:

avg({<CalendarDate={">=$(=date(max(CalendarDate)-90,'DD/MM/YYYY'))"}>}urMeasure)

View solution in original post

3 Replies
OmarBenSalem

Let's assume that ur calendar date is recognized by qlik as a date and has a format as follow : DD/MM/YYYY

do sthing as follow:

avg({<CalendarDate={">=$(=date(today(1)-90,'DD/MM/YYYY'))"}>}urMeasure)

or (depends on what type of analysis u want, it maybe be:

avg({<CalendarDate={">=$(=date(max(CalendarDate)-90,'DD/MM/YYYY'))"}>}urMeasure)

Thiago_Justen_

What about this:

avg( {<CalendarDate={">=$(=AddMonths(Date (Today ()),-3))"}>} ($(vCheckinTime))*1440)

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
pablolabbe
Luminary Alumni
Luminary Alumni

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others