Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
botlhokots
Contributor II
Contributor II

Set analysis/Set Expression

Hi all,

I hope all is well.

Please assist in building in a set expression to pull the last 3 months in a measure. 

The measure is Avg(OFFLOAD_TAT), and the date field in format "2024-09-01 05:30:00.000000" called DropArrive

Labels (1)
3 Replies
sk88024
Creator
Creator

May be this:

rangesum(above(Avg(OFFLOAD_TAT),0,3))

If not, you can provide some sample data with output examples for more clarity. 

botlhokots
Contributor II
Contributor II
Author

Avg({<Contract= {'Invoiced'}>} OFFLOAD_TAT)

Using this example where I put in a condition for Contract. I want to do the same for the Date Field and returning the last 3 months.

 

sk88024
Creator
Creator

Try this:

Avg({$<Date={">=$(=MonthStart(AddMonths(Today(),-4))) <$(=MonthEnd(AddMonths(Today(),-1)))"}>} OFFLOAD_TAT)

OR

=Avg({<Date = {">$(=Max((Addmonths(Date,-3)))) <$(=Max (Addmonths(Date)))"}>} OFFLOAD_TAT)