Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I would like to count the distinct number of sessions where trader A and B both participated on a Tuesday. Should the set analysis look like this?
count({<SessionId = p({<[TraderName] = {'Mark'}>}) * p({<[TraderName] = {'Bob'}>}),Day={'Tues'}>} distinct SessionId)
What about this:
Count({<SessionId = p({<[TraderName] = {'Mark'}, Day={'Tues'}>}) * p({<[TraderName] = {'Bob'}, Day={'Tues'}>})>} distinct SessionId)
May be like:
count({<[TraderName] = {'Mark'},Day={'Tues'}> *<[TraderName] = {'Bob'}>},Day={'Tues'}>} distinct SessionId)
What about this?
Count({<SessionId = p({<[TraderName] = {'Mark', 'Bob'}, Day={'Tues'}>})>} distinct SessionId)
Hi sunindia, this is close, but it's doing Mark OR Bob. How can we make it count sessions for Mark AND Bob ?
tresesco expression did not work as well?
Yes, that one seems to return zero.
What about this:
Count({<SessionId = p({<[TraderName] = {'Mark'}, Day={'Tues'}>}) * p({<[TraderName] = {'Bob'}, Day={'Tues'}>})>} distinct SessionId)
I think it would be better to create a sample either by some one to see the results
Thanks, I just checked the data and it looks like both these variations work:
count({<SessionId=p({<[TraderName] = {'Bob'},Day={'Tue'}>})*p({<TraderName={'Mark'},Day={'Tue'}>})>}distinct SessionId)
OR
count({<SessionId = p({<[TraderName] = {'Bob'}>}) * p({<[TraderName] = {'Mark'}>}),Day={'Tue'}>} distinct SessionId)
Any idea why tresesco's doesn't work? Is it because TraderName itself cannot be 2 different names simultaneously?
Yes, you are right, a single row of data cannot have both TraderName on it. But a single SessionId can have multiple rows where one contains Mark and other contains Bob. He might have forgot to add SessionId and the p.