Click in the JOIN GROUP button in Home to follow our news and attend our events!
Hi all,
How do we use CONTINUE and BREAK Keywords in Alteryx?
Please let me know how to replicate the below SQL code in Alteryx.
IF @YR < CAST(DATEADD(DAY,1-DAY(GETDATE()),GETDATE()) AS DATE)
CONTINUE
ELSE
BREAK
Awaiting your response.
Thanks & Regards,
B. Sreenivasa Teja.
from what I've read (https://docs.microsoft.com/en-us/sql/t-sql/language-elements/while-transact-sql?view=sql-server-ver1...) it's used in while loops, which in Alteryx is a macro. but for If statements in SQL you use:
IF <TEST> < <CONSTRAINT>
BEGIN
<code here>
END
ELSE
BEGIN
<code here>
END;
Which in Alteryx is the filter or formula block depending on what you want to do, if something is true.
Hi @stj1120 ,
As @Many-to-Many_Worker says, a simple filter may achieve what you want to do, or if you are trying to execute a more complex process there may be a need to employ a macro or some other functionality.
No matter what language or tool you are translating between, it is not always possible to pick a specific tool to replace each occurrence of a particular function or expression. Different languages and tools have different strengths and weaknesses, and as a result, it is often useful to approach problems in a different way in different environments.
The more experience you gain of Alteryx, or any other language / environment, the easier you will find it to solve problems in that environment and the best ways to do so that make the most of that environment's strengths.
The Weekly Challenges are a fantastic place to see how different people solve the same problem, which can open your mind to the different ways you can approach similar problems in the future.
Alternatively, if you have a particular workflow that you are having problems with, or have specific data you want to transform into a format that you can clearly specify, we can take a look for you. It is hard to advise on a generic question such as your question in this thread as the answer can depend on the exact circumstances you are looking at.
I hope this helps.