I'm trying to fix the following error in my flow and don't have much Alteryx experience to solve what probably is a simple issue.
The expected utilisation rate data is recorded in the below format:
I keep getting this error when trying to run my flow: Parse Error at char(99): Malformed If Statement (Expression #1)
Can someone tell me what I'm doing wrong?
You need to provide an 'Else' and 'Endif' clause, for example:
If [what is the expected utilisation rate?] > 1
THEN [what is the expected utilisation rate?]/100
ELSE xx
ENDIF
where xx is the default output if the IF statement doesn't work
Editing because I didn't read the Q properly in my haste. The above answer should cover it, just check that the data types are correct as well and you should be good
Good spot @JamesCharnley
@aoifemccormack you're trying to apply a numerical calculation to a string field:
Thanks both! @JamesCharnley @davidskaife
Another beginner question here sorry, but what should I change the data type to to accept the calculation?
No worries @aoifemccormack
You'll want some kind of numeric data type that allows decimals. Fixed decimal, float or double should all work in this instance. I truthfully just default to double pretty much any time unless working with large data sets
@aoifemccormack to add on - I will use Fixed more often because I can set the number of decimal points (19.2 would be two decimal points, 19.3 would be 3 decimal points).
If in doubt about what data type to use, you can always insert an Autofield tool into your flow. Just check to make sure that Alteryx has made the correct decision/that the decision fit your intended use case (for example, some of Alteryx's choices do not always work nicely with excel further down the line).