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

Alteryx Designer Desktop Discussions

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

Unmatched(

young351
6 - Meteoroid

I cannot get this expression written out correctly.  Each line works on it's own, but when put together I am getting an Unmatched( error.

 

 

 

IF ([End Date] != [List of Dates] && [Start Date] != [List of Dates] then 24*60)

ELSEIF ([End Date] > [List of Dates] then DateTimeDiff([Start Date_Time],[Row+1:List of Dates], 'Minute')

ELSEIF ([End Date] > [List of Dates] then DateTimeDiff([Start Date_Time],[Row-1:List of Dates], 'Minute')


ENDIF

4 REPLIES 4
DanielG
12 - Quasar

@young351   looks like you are short a couple of closing brackets...  

 

spreading it out makes it easier to see how many open and close brackets you have/need.  After the first ElseIf you need to close that one out before the next Elseif then close the final function at the very end with another close bracket.  Or remove the open bracket at the beginning of each ElseIf as I dont think you need to bracket them at all.  Also, the brackets around the original IF statement can probably be removed too.  Hope this helps.

 

IF
(
[End Date] != [List of Dates] && [Start Date] != [List of Dates] then 24*60
)

ELSEIF
(
[End Date] > [List of Dates] then DateTimeDiff
(
[Start Date_Time],[Row+1:List of Dates], 'Minute'
) ADD ONE HERE

ELSEIF
(
[End Date] > [List of Dates] then DateTimeDiff
(
[Start Date_Time],[Row-1:List of Dates], 'Minute'
) ADD ONE HERE

IraWatt
17 - Castor
17 - Castor

Hey @young351,

Few things too look at here though it hard to say without some example data.

Three points:

I think you have one too few brackets at the end.

You need an ELSE statement at the end.

Both your ELSEIF conditions are the same.

 

try writing it like this:

 

IF [End Date] != [List of Dates] && [Start Date] != [List of Dates] then 24*60

ELSEIF [End Date] > [List of Dates] then DateTimeDiff([Start Date_Time],[Row+1:List of Dates], 'Minute')

ELSEIF [End Date] > [List of Dates] then DateTimeDiff([Start Date_Time],[Row-1:List of Dates], 'Minute')

ELSE NULL()

ENDIF

The community has some quick and easy videos on formulas and the Formula Tool here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Writing%20...

 

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

DanielG
12 - Quasar

Nice writeup @IraWatt much more eloquently put than me.  😀

IraWatt
17 - Castor
17 - Castor

Thanks @DanielG 😆

Labels
Top Solution Authors