Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Nested if statment

julianhoetzel
8 - Asteroid

Hi guys, 

 

I have two issues to solve:

1) I need a double conditional statement (nested if statement)

2) I need the clients only to be added up that are existent in the file. Otherwise they should not be added up in the date structure (Missing amounts of Saturday and Sunday become Friday values)

 

Example: 

 

DateDayAmountFileName
2021-01-01Friday10FileName20210101
2021-01-04Monday30 
2021-01-05Tuesday40FileName20210105

 

So the output file should only include values if a FileName is included on the date, therefore excluding Monday from the file and from any metrics.

 

DateDayAmountFileName
2021-01-01Friday10FileName20210101
2021-01-02Saturday10FileName20210101
2021-01-03Sunday10FileName20210101
2021-01-05Tuesday40FileName20210105

 

The multirow formula looks like this:

julianhoetzel_0-1623683278578.png

 

So i need some if statement that says

 

if contains([FileName]=shows something then if (datetimediff([Row+1:Date],[Date],"days"))>1
then datetimeadd([Row+1:Date],-1,"days") else Date endif

 

Hope that makes sense.

Cheers

Julian

 

1 REPLY 1
mceleavey
17 - Castor
17 - Castor

Hi @julianhoetzel ,

 

I've built this using a generate rows tool to create those missing dates, and then determined the days of the week for those missing dates using a simple formula.

 

I then used a tool I built which auto-fills the missing values, leaving everything populated as you wanted, then it was a simple matter of filtering out the unwanted rows:

 

mceleavey_0-1623685455393.png

 

mceleavey_1-1623685500064.png

 

 

I've attached the exported workflow, and the manual files if you are on an older version.

 

I hope this helps,

 

M.

 



Bulien

Labels