Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IIf(tblDetailJournal!Account Like "10*",Null,tblDetailJournal!Region) AS Region

diva
5 - Atom

How do we put this statement IIf(tblDetailJournal!Account Like "10*",Null,tblDetailJournal!Region) AS Region in alteryx ??/

5 REPLIES 5
danrh
13 - Pulsar

The easiest way would probably be something like this in a Formula tool:

 

IIF(Left([tblDetailJournal!Account],2)="10", Null(), [tblDetailJournal!Region])

 

image.png

diva
5 - Atom

sorry, its not working here I need the details of the account that start with 10 and the solution you have given is giving null records

danrh
13 - Pulsar

It looks like the original formula you gave is from Access and will produce a column named Region that has a null for all fields where the Account starts with "10" and will give the Region for all the other rows.  Are you looking to null out all Regions where the Account starts with "10", or are you looking to filter down to records where the Account starts with "10"?

 

The provided formula will null out the Region for "10" records..  In your attached screenshot, it looks like you've changed Null() to IsNull(0).  Null() produces a null value.  IsNull(0) checks whether the constant "0" is null (which it never will be) and returns a boolean, true or false.

 

If you're looking to filter down to just the "10" account records, try a Filter tool.  Choose "Custom Filter" and enter

 

Left([Account],2)="10"

as the expression.

 

If I'm completely missing the boat on this one, let me know.  If so, some sample data and your expected output would be helpful.  Hope it helps!

 

diva
5 - Atom

thank you for the solution

danrh
13 - Pulsar

You bet, glad it worked!

Labels