Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
The Expert Exam is now live online! Read about the specifics and what it took to bring it to life in the blog by our very own Elizabeth Bonnell!
SOLVED

Unable to run this code

Highlighted
7 - Meteor

Hi, I cannot run this code on filter, is there anything I type wrong?

 

[F1] = IF [Current Month]<4 THEN "Q1" ELSEIF [Current Month]<7 and [Current Month]>3 THEN "Q2" ELSEif [Current Month]<10 and [Current Month]>6 THEN "Q3" ELSE "Q4" ENDIF

 

Highlighted
Alteryx Partner

Hi @terrellchong  the reason why this code is working seems to be like you are using a wrong tool, try using formula tool as mentioned ni the screenshot. Then use filter tool to filter Q1,Q2,Q3,Q4.

I hope this helps.

Thanks.

 

grazitti_sapna_0-1593768149596.png

 

Highlighted
7 - Meteor

Hi Graziti, good to hear from you again.

 

The reason that I want to use it in filter is because I want the sheet to be smart enough to choose the necessary criteria for a report. (for example, when it was January, it will automatically choose Q1 so on and so forth.

 

I tried to add tostring() in front of it but it wasnt working too.

 

Is there any tool that you would recommend me to use for my type of cases?

 

 

Highlighted
Alteryx Partner

@terrellchong , will it be possible for you to share a sample workflow along with the output so that I can look into it?

Thanks.

Highlighted
7 - Meteor

Yes, here you go.

Highlighted
7 - Meteor

@grazitti_sapna Sorry the output will be looking like this

F1Current Month
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Q25
Highlighted
Alteryx Partner

Hi @terrellchong ,I guess this is what you are looking for.

 

Try using this formula in filter as per the output you mentioned.

 

IF [Current Month]<4 THEN F1="Q1" ELSEIF [Current Month]<7 and [Current Month]>3 THEN F1="Q2" ELSEif [Current Month]<10 and [Current Month]>6 THEN F1="Q3" ELSE F1="Q4" ENDIF

 

grazitti_sapna_0-1593770032328.png

 

Highlighted
7 - Meteor

Thank you once again ya!

Highlighted
Alteryx Partner

Welcome!

Labels