Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select Sells where first Contact was in a give timeframe

Hi,

hope someone can help me with this. I have the following data:

NameDateAction
Peter01.01.2014First Contact
Peter01.05.2014Sell
Max01.08.2014First Contact
George01.04.2014First Contact
George01.06.2014Sell
Jim01.02.2014First Contact
Jim01.10.2014Sell
Luke01.02.2014First Contact
Luke01.10.2014Sell

Now I want to count the sells from each person where the first contact was between 01.01.2014 - 28.02.2014.

So it should count 3 times:

Sells where First Contact was between 01.01.2014 - 28.02.2014
NameDateAction
Peter01.05.2014Sell
Jim01.10.2014Sell
Luke01.10.2014Sell

Because Peter's first contact was on 01.01.2014.

Jim's first contact was on 01.02.2014.

Luke's first contact was on 01.02.2014.

Can anybody help me with this.

Is it possible with set analysis?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Right you are. A typo. Try this expression:

only({<Action={'Sell'},Name=p({<Action={'First*'},Date={'>=$(vStart)<=$(vEnd)'}>}Name)>}Date)


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Hello Gysbert,

thank you for your help.

I tested it, but when I select for example 01.08.2014 - 01.10.2014 it shows me 4 entries, but it should show no one, because only Max has his first contact on 01.08.2014, but has no sell...

Gysbert_Wassenaar

Right you are. A typo. Try this expression:

only({<Action={'Sell'},Name=p({<Action={'First*'},Date={'>=$(vStart)<=$(vEnd)'}>}Name)>}Date)


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you!! It works!

Can you explain, what does the p stand for in the expression?

Gysbert_Wassenaar

P is for possible. It selects those Name values that have a record with Action starting with First and Date between the values of the variable vStart and vEnd.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert! You helped me so much!!