Hi, I have questions for different scenarios as below. Really appreciate any help!
Scenario A: I want to add this last column, calculating for that userID, what's the day difference from first web to first booking date. If he had no web action prior to booking action, then leave it empty. Could someone help me with what the formula should look like using the function but not jsl?
| userID | action | date | first web date to first booking date |
| 2523 | web | 2018-05-06 | 22 |
| 2523 | web | 2018-05-16 | 22 |
| 2523 | booking | 2018-05-28 | 22 |
| 2523 | booking | 2018-06-08 | 22 |
| 2523 | web | 2018-07-08 | 22 |
| 2523 | booking | 2018-08-08 | 22 |
Scenario B: based on the above table, I want to calculate another table like the below that contains for each userID, day difference between 'the first web action date' 'before bookings' to each booking date. Based on the logic, the ideal result with the above table as input will be as below, 3 instances of day difference for this userID. Same as in scenario A, we only consider when web is prior to booking.
| userID | instance | calculation |
| 2523 | 22 | 5/28 minus 5/6 |
| 2523 | 33 | 6/8 minus 5/6 |
| 2523 | 31 | 8/8 minus 7/8 |
Thank you!