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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ramyasaiqv
Creator II
Creator II

Set analysis expression to exclude Date selection

Sum(If(YYYYMM=Max(total {<[Amount]={"=Len(trim([Amount] ))>0"}>} YYYYMM), Amount,

If(mod(MonthNum,3)=0 , Amount)))/Count(distinct TOTAL [item])

I have this expression and is used in chart that works fine. I have a list box with “Date” and I want the above expression should be independent of “Date” selection

I’m struggling to include ({$<[Date]= >} in the above expression so that the expression will be independent of “Date” selection. Please can someone help me in writing the correct set expression . Thank you,

Ramya

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try incorporating the date selection ignorance (using set) in all the aggregation functions, like:

Sum( {<Date>} If(YYYYMM=Max(total {<Date, [Amount]={"=Len(trim([Amount] ))>0"}>} YYYYMM), Amount,

If(mod(MonthNum,3)=0 , Amount)))/Count(distinct TOTAL {<Date>} [item])

View solution in original post

6 Replies
techvarun
Specialist II
Specialist II

May be?

Sum(If(YYYYMM=Max(total {<[Amount]={"=Len(trim([Amount] ))>0"}, Date = {'*'}>} YYYYMM), Amount,

If(mod(MonthNum,3)=0 , Amount)))/Count(distinct TOTAL [item])

tresesco
MVP
MVP

Try incorporating the date selection ignorance (using set) in all the aggregation functions, like:

Sum( {<Date>} If(YYYYMM=Max(total {<Date, [Amount]={"=Len(trim([Amount] ))>0"}>} YYYYMM), Amount,

If(mod(MonthNum,3)=0 , Amount)))/Count(distinct TOTAL {<Date>} [item])

its_anandrjs
Champion III
Champion III

Try with

Sum(If(YYYYMM=Max(total {<[Amount]={"=Len(trim([Amount] ))>0"},DateField=>} YYYYMM), Amount,

If(mod(MonthNum,3)=0 , Amount)))/Count(distinct TOTAL [item])

ramyasaiqv
Creator II
Creator II
Author

It worked. Thank you Tesesco.

ramyasaiqv
Creator II
Creator II
Author

Thank you for the response Anand.

ramyasaiqv
Creator II
Creator II
Author

Thank you for the response Varun.