Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to get this week's date when you have the weekday

soncoku
9 - Comet

I have this table:

 

IDMONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY
50012002050006090

5002

300405020256510
5003690557080101060

 

And I want to achieve this:

 

IDRevenuePeriod
500142008.14-06-2020
500251008.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 what's the date for Monday and Sunday for this week 

For example :

Monday == 08

Sunday == 14

 

So that last column would have 08.14-06-2020

 

Does anyone have any ideas on this?

4 REPLIES 4
bhrmitra
10 - Fireball

Hi 

 

I've attached my workflow for you to download if needed.

 

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

RobertOdera
13 - Pulsar

Hi, @soncoku 

 

Try this.

Please mark as a solution + like, if it works for you.

 

I've offered a different treatment for your consideration

I feel that the current solutions offered might be problematic when:

 

1. your week crosses months

2. your months cross years

 

Therefore, I provided a 'Period' treatment that is optically different (it includes the running month + year).

If I'm way off, apologies.

 

RNO2_0-1591630653130.png

Cheers!

soncoku
9 - Comet

@bhrmitra @RobertOdera 

 

The code of bhrmitra is working okay but only for the current week. (And that's fine) But I forgot to mention that sometimes I will need to go back for weekly reports.

 

For example I'll need a weekly report from the past 2 weeks.

 

I have a filter where I choose the range for a past week, from Monday to Sunday (always).

Now the code of the @bhrmitra always gives me the current week on the Period, even though I'm seeing the report of 2 weeks ago.

 

I've attached a picture for you to see.

 

So the idea is that if I choose a past week in the filter tool I want the last column to the dates of that week in the Period.

example (25.31-05-2020)

bhrmitra
10 - Fireball

Hi 

 

I have used a Text Input tool for you to enter the custom date. Remember you have to provide this date even for this week as well.

 

Untitled picture.png

 

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

Labels