I have a table with records like below:
ID | DATE | Revenue | Day |
5001 | 01-06-2020 | 20 | Monday |
5001 | 06-06-2020 | 25 | Saturday |
5004 | 08-06-2020 | 24 | Monday |
5004 | 08-06-2020 | 22 | Monday |
5004 | 14-06-2020 | 36 | Sunday |
What I want to achieve is this:
Using the filter to automatically get the data of current week and then get the result like below
ID | Revenue | Period |
5004 | 82 | 08.14-06-2020 |
08 == Monday of this week
14 == Sunday of this week
06 == month
20 == year
Any suggestions?
Solved! Go to Solution.
@soncoku ,
if you filter by day = "Monday", you could sort on date descending. Then you could sample the first 1 records. Using an append fields Tool, is is possible to spend the date to each of the original records as Date2.
Now you can filter on date >= date2.
summarize by id and sum revenue and you're done!
Cheers,
mark
Hi soncoku,
I hope I have understood your problem statement correctly.
If this solves your issue please mark the answer as correct and also hit the like button, if not let me know! I've attached my workflow for you to download if needed.
Thanks,
Abhra Mitra
that's perfect.
Now I've taken another workflow to another level.
ID | MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY | SATURDAY | SUNDAY |
5001 | 200 | 20 | 50 | 0 | 0 | 60 | 90 |
5002 | 300 | 40 | 50 | 20 | 25 | 65 | 10 |
5003 | 690 | 55 | 70 | 80 | 10 | 10 | 60 |
i HAVE THAT
And I want to achieve this:
ID | Revenue | Period |
5001 | 420 | 08.14-06-2020 |
5002 | 510 | 08.14-06-2020 |
I only have the weekdays, but the values on the weekdays are always this weeks data.
So I need something that get's the current week and finds whats the date for Monday an Sunday for this week
For example :
Monday == 08
Sunday == 14
So that last column would have 08.14-06-2020
Do you think you could help me this too?
Hi soncoku,
I've attached my workflow for you to download. If this solves your issue please mark the answer as correct and also hit the like button, if not let me know!
Thanks,
Abhra Mitra
Thank you very much.
You sir, you deserve a medal 😄
The solution was very efficient and the code was professionally structured.