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
@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
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
Nice writeup @IraWatt much more eloquently put than me. 😀
Thanks @DanielG 😆 !
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |