Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello I have the following Table
USER_ID,
ONLINE_BOOKING_COUNT,
PHONE_BOOKING_COUNT
Here is a sample.
USER_ID | ONLINE_BOOKING_COUNT | PHONE_BOOKING_COUNT |
469 | 3 | 3 |
325 | 0 | 1 |
974 | 1 | 3 |
322 | 2 | 0 |
503 | 2 | 4 |
734 | 0 | 0 |
283 | 1 | 5 |
280 | 1 | 0 |
283 | 0 | 5 |
900 | 0 | 0 |
974 | 3 | 1 |
I want to Count the Number of Users who Did the booking.
How do I count?
Thanks
Hi,
You can use expressions in set analysis:
Count({< ONLINE_BOOKING_COUNT -= {0} > + < PHONE_BOOKING_COUNT -= {0} >} USER_ID)
That will return the set of USER_ID that are not zero in either ONLINE or PHONE. You can change that "+" for a "*" in case you want the intersection instead of the sum of sets (not zero in ONLINE AND in PHONE).
Hope that helps,
Miguel
Hi,
You can use expressions in set analysis:
Count({< ONLINE_BOOKING_COUNT -= {0} > + < PHONE_BOOKING_COUNT -= {0} >} USER_ID)
That will return the set of USER_ID that are not zero in either ONLINE or PHONE. You can change that "+" for a "*" in case you want the intersection instead of the sum of sets (not zero in ONLINE AND in PHONE).
Hope that helps,
Miguel
Hi Miguel
Thank you for the quick response. I am trying to understand the set statement (for beginers like me I think need more practice). Is the above statement prevents duplicates as there are users who used bother ONLINE and OFFLINE. So we should count as one instead of two.
Also you mentioned the change '+' to '*' . what is intersection?
Hi,
The "*" set modifier is used like the AND modifier, meaning "all in both set modifiers". In the case above, count when value is not zero for both fields.
Hope that helps,
Miguel