This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Lesson Objective: Structure conditional statements to apply logic to data values
Estimated Time: ~13 Minutes
Recommended Follow-Up: Evaluating Empty and Null Values, Preparing Data with String Functions
A minor typo of < instead of <= in the if then else endif clause causing the condition to look incomplete
Good catch, @shashi!
screen is frozen, i cannot add my answer here.
I chose in the final question the "If/then" statement, but for some reason it said I chose the boolean statement. Why?
Tried again. No matter what I choose it says I chose Boolean.
@douglasgregory418, the "Incorrect" message for that final quiz question explains that two answers can be used to correctly answer this question, and why the other (no spoilers!) is not correct. I hope that helps with interpretation of that message!
May it helps others that need louder volume to the awesones presentationsthis tool did it for me (freeware)EqualizerAPO: http://sourceforge.net/projects/equalizerapo/
I think there a logical error on the If then elseif statement. The formula would assign a value of 1 to ages over 18 and under 35; this means 19 thru 34, and it would assign the value 2 to ages over 35 and under 60; this means 36 thru 59, and it would assign the value of 3 to ages over 60; this means; 61+. Thus age 35 would get the assignment of 3 and any other negative number; however, age 60 would still get the default 3.
Good catch @JORGE4900! You're right on with the details. For the purposes of the demonstration, the values will work but, with any more variability in the input dataset, you'd have to make some adjustments to the conditional logic.
@ChristineB No worries
I'm new with Alteryx and all that videos are good for me to learn, thanks a lot
@AlexandreCB I'm so glad you're finding them helpful!
Can we have the sample files to improve the effectiveness of the lessons?
The sound cuts out in screen 3. Is there another lesson I could follow to make up for this section?
It is worth noting that people under 18 would get a value of 3, and that the 'elseif' should probablly cover the range or expected results and the else result in an error message to catch data quality issues in the data set. But good work, nicely explained.
There is a bug in the second question. I added ENDIF at the end of the statement and got my answer as incorrect. The correct answer would be to add ENDIF at the end of statement what exactly I did.
I answered the last 2 questions correctly: added the ENDIF at the end of the statement, and chose the SWITCH statement for the second question. Both were marked incorrect.
You have a typo in this presentation at the boundary values of conditions. For example you selected < 35 for Category "1" and > 35 for category "2". What about = 35? Do you see it?
-- Omitted - The 3rd question is multiple choice.
Is formula case sensitive? for 2nd question I typed elseif, and it resulted incorrect
The lesson is frozen on Question No.2
Cannot continue with the lesson.
The lesson was good as it introduced to some new conditional statements and how easy they are to deal with large data,
I am assuming that the IF THEN ELSEIF THEN ENDIF works similar to an SQL CASE statement in that once it encounters a TRUE condition and performs the associated THEN clause for a given record, it drops down to the ENDIF for that record (effectively moving on to commence testing the next record)?
Therefore in regards the Session Category formula it would be sufficient to have:
IF [Duration of Visit (mins)] >= 30 THEN "Long"
ELSEIF [Duration of Visit (mins)] >= 5 THEN "Medium"
ELSEIF [Duration of Visit (mins)] < 5 THEN "Short"
ELSE [Duration of Visit (mins)]
... as at the "Medium" test step the additional criteria of AND [Duration of Visit (mins)] < 30 as presented in the slides is superfluous given records with duration >=30 would have been actioned as "Long" and not tested further.
Question two does not read ENDIF correction
Thank you for the tutorials - very helpful