Hi ,
Can anyone help me how to write the below logic in alteryx i am new to it.
IF Contain [Journal Category] , "M","MA","MR" then [Journal Description] Else [Transaction Code] Endif
I am getting this error.
Solved! Go to Solution.
Hi @Amy123,
IF [Jorunay Category] In ("A","B","C") would should you only positions equal to A or B and C.
If you want to use contains function for several arguments I would use the find and replace tool as it would be easier to maintain in a long run. Unless if you have a big data set.
If you have big data set you can write IF 1 st contain function OR 2 nd contain function OR 3 rd contain function etc.
Try: IF Contains([Journal Category], "M") OR Contains([Journal Category], "MA") OR Contains([Journal Category], "MR") THEN [Journal Description] ELSE [Transaction Code] ENDIF
Hi @Amy123
If my chance that your Journal Category that you attempt to isolate the description for each start with 'M', try:
IF StartsWith[Journal Category], "M") THEN [Journal Description] ELSE [Transaction Code] ENDIF
@HomesickSurfer ,@Amy123 ,@Emil_Kos ,
I want to point out that M, MA and MR all contain "M".
If you are really looking for M, MA, MR as the "Whole Value", then use an in clause
IIF([Journal Category] in ('M', 'MA', 'MR'), [Journal Category], [Transaction Code])
otherwise,
IIF(Contains([Journal Category],"M"), [Journal Category], [Transaction Code])
Cheers,
Mark
Hi @MarqueeCrew
I like both of your formula expressions. I trust that the below 'StartsWith' can work if the values begin with 'M' as 'Contains' will also include 'AM, PM, FM, Mickey Mouse, etc..'
IIF(StartsWith([Journal Category],"M"), [Journal Category], [Transaction Code])