Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

avg of a measure after a certain date using set analysis

Hi, I have two table which contains date. I have to compare if the dates in table 1< dates of table 2 . If the condition is true I need the average of SOH in table 2 till that date.

  

Table 1                                        Table 2
Column 1                                                               Column 2SOH
12/1/20151/23/201684
11/5/20151/24/2016474
9/3/20151/25/2016425
12/25/20151/26/2016319
12/26/20151/27/201664
12/27/20151/28/2016328
12/28/20151/29/2016374
12/29/20151/30/2016162
12/30/20151/31/2016202
12/31/20152/1/2016285
1/1/20162/2/201621
1/2/20162/3/201692

So far when I'm trying to use set analysis or if statement I'm getting the below result

Capture.PNG

I need the average of SOH for dates greater than Stop buying date to current date. But I'm getting 0 values for it. Please help

5 Replies
sunny_talwar

Would you be able to share a sample and also provide the expected output with the logic you need for the calculation

Not applicable
Author

Hey Sunny,

The sample is attached above. The expected outcome I need is the average of SOH for the dates which are after Stop Buying Date and less than current date.

sunny_talwar

I don't see anything attached (.qvf) with either of your two messages above?

Not applicable
Author

Attached the qvf file. What I'm trying to do is explained above. In this qvf I've done a makeshift job I've created 4 variables which contain the stop dates and done the comparison with today's date. I could do this because there were only 4 stop dates. But in case if there are more no of rows how should I go about.

Not applicable
Author

stalwar1‌ Hi Sunny did you get a chance to see this ?