Alteryx Designer Desktop Discussions

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

ForEach formula expression in Alteryx

GP2
6 - Meteoroid

Is there a way to create an expression in Alteryx where it looks up conditions for each variable in a certain field.

 

Room ID

Category

A

Cat 1

A

Cat 3

A

Cat 4

B

Cat 1

B

Cat 2

 

So for example for the above table I want an alert to be raised if a specific room ID contains both Cat 1 and Cat 3.

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @GP2 

 

You can use either the Message Tool or the Formula tool with Message function.

 

See example:

 

message1212.PNG

 

 

You can see Designer actually left warnings when it found the records that you mentioned.

IF [Category] in ('Cat 1', 'Cat 3') THEN
Message(2, "Alert", "False")
ELSE "True" ENDIF

 

This goes to the log of your workflow.

 

The Message Function can be referenced here: https://help.alteryx.com/2018.2/Reference/Functions.htm

These are the message types:

 

  • 1 = Messages
  • 2 = Warnings
  • 3 = Errors
  • 5 = Conv Errors (field conversion errors)
  • 8 = Files (input)
  • 9 = Files (output)

Let us know if you have questions.

 

Cheers,

 

mceleavey
17 - Castor
17 - Castor

HI @GP2 ,

 

I've built a quick workflow which groups the categories by Room ID, and so you can see if Room A has both Categories:

 

Workflow.PNG

Depending on how you want to be alerted you can use the Messaging tool. I've used an email tool to send you an email if it happens.

 

Hope this helps.

 

M.

 

 



Bulien

MarqueeCrew
20 - Arcturus
20 - Arcturus

@GP2 ,

 

I'd solve by searching the results of a Summarize (via concatenation) with this formula:

Contains([Concat_Category], "Cat 1") AND 
Contains([Concat_Category], "Cat 3")

capture.jpg

 

Cheers,

 

Mark 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
afv2688
16 - Nebula
16 - Nebula

Hello @GP2 ,

 

Hope this helps!

 

Cheers

Labels