Alteryx Designer Desktop Discussions

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

Date formula

Jwwwson
8 - Asteroid

Hi, 

 

I would like to seek your kind advice on the date formula. Please refer to below for the data:

ShopClosing dateExpected revenue (M) -  1 May 2020 - 15 May 2020Expected revenue  (M) -  16 May 2020 - 31 May 2020
102-02-208080
206-06-2016020
305-05-203235
418-05-2048

80

 

What I would like to do is to decide if I shall keep the expected revenue of the corresponding shop or not. Here is some scenarios, the first one is the shop closed before May; second scenario is the shop close after May 2020; third one is the shop closed during the first half of May; and the last one is it closed during the second half of May. And I would like to produce the results as shown below, which is, for shop that closed during the first half of May, all the expected revenue for whole May is deemed to be 0; while if it closed during the second half of May, only the expected revenue of second half of May is deemed to be zero. 

 

ShopClosing dateExpected revenue (M) -  1 May 2020 - 15 May 2020Expected revenue  (M) -  16 May 2020 - 31 May 2020
102-02-2000
206-06-2016020
305-05-2000
418-05-20480

 

Is there any simple workflow that can achive this goal? Many thanks in advance. 

 

Cheers, 

 

2 REPLIES 2
deviseetharaman
11 - Bolide

Hi @Jwwwson 

 

Please try using the below formula

if DateTimeMonth([Closing date]) < 5 then 0 elseif DateTimeMonth([Closing date]) = 5 and DateTimeDay([Closing date]) < 15 then 0 else [Expected revenue (M) -  1 May 2020 - 15 May 2020] endif

 

if DateTimeMonth([Closing date]) <= 5 then 0 else [Expected revenue  (M) -  16 May 2020 - 31 May 2020] endif

 

 

dateformat.png

Jwwwson
8 - Asteroid

@deviseetharaman Thanks! It works!

Labels