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: 
bharatkishore
Creator III
Creator III

Need to calculate avg based on selection filter

Hi All,

I am using an pivo table chart and i am using it to display average of last 3 weeks. As of now the last 3 weeks is coming exactly.

But now my problem is i need to take an week filter and what ever week they selects in the multi box based on that particular week the average of last 3 weeks should come.

For example i have data like

10/5/2015

10/12/2015

10/19/2015

10/26/2015

11/2/2015

11/9/2015

11/16/2015


Now if  select 10/26/2015 the avg should come for 10/26.10/19,10/12

if i select 11/16/2015 the avg should come for 11/16/2015,11/9/2015,11/2/2015


Can you please help me how can i achieve this.


Attached qvw for reference.


Thanks

Bharat

1 Solution

Accepted Solutions
sunny_talwar

Can you check if attached looks like what you are looking for?

View solution in original post

7 Replies
qliksus
Specialist II
Specialist II

Hi

As you have already defined the Last 3 weeks logic in the backend  use the below set analysis to get the result

(sum({<Week={">=$(=date(min(WeekKey)))<=$(=date(max(WeekKey)))"}>}Opt_Spend)/sum({<Week={">=$(=date(min(WeekKey)))<=$(=date(max(WeekKey)))"}>}Opt_Impressions)*1000)

bharatkishore
Creator III
Creator III
Author

Thanks Susant. Will try and let you know.. thank you...

bharatkishore
Creator III
Creator III
Author

Hi Susant,

I have tried but it isn't working..

sunny_talwar

Can you check if attached looks like what you are looking for?

bharatkishore
Creator III
Creator III
Author

Thanks Sunny.. But i figured the solution....Thanks a lot for ur help...

bharatkishore
Creator III
Creator III
Author

But your solution also helped me....Thanks...

sunny_talwar

No problem at all