Hello,
I have a data which looks like this.
Product | Event | Date |
1 | A | 2019-01-02 |
1 | B | 2019-04-06 |
1 | C | 2019-06-04 |
2 | D | 2019-05-08 |
2 | E | 2019-06-02 |
I want to write a logic which says if current date is between any two dates for a product, then it is current, else it is future and also provide a date based on the type of event.
Output should look like this:
Eg:
For Type:
Today's date lies between Event B and Event C for product 1, Hence the type is 'current'
Today's date lies before event D date for Product 2, hence the type is 'future'
For date:
If the type is 'current' then, date = 'Today's date'
If type = 'future', then it has to take the first date for that product and add 1.
Product | Type | Date |
1 | Current | 2019-04-08 |
2 | Future | 2019-05-09 |
Can someone help me how to proceed on this?
Solved! Go to Solution.
Hi @hash_89
Would this work?
Let me know if you have any doubts in the logic part of the workflow. I made some assumptions about what you said.
Cheers,
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |