5 Replies Latest reply: Jun 16, 2016 2:27 AM by Shivam Sarin

# 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 2 SOH 12/1/2015 1/23/2016 84 11/5/2015 1/24/2016 474 9/3/2015 1/25/2016 425 12/25/2015 1/26/2016 319 12/26/2015 1/27/2016 64 12/27/2015 1/28/2016 328 12/28/2015 1/29/2016 374 12/29/2015 1/30/2016 162 12/30/2015 1/31/2016 202 12/31/2015 2/1/2016 285 1/1/2016 2/2/2016 21 1/2/2016 2/3/2016 92

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

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

• ###### Re: avg of a measure after a certain date using set analysis

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

• ###### Re: avg of a measure after a certain date using set analysis

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.

• ###### Re: avg of a measure after a certain date using set analysis

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

• ###### Re: avg of a measure after a certain date using set analysis

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.

• ###### Re: avg of a measure after a certain date using set analysis

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