We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Contains in an in-db formula tool

maygross
8 - Asteroid

I am trying to create a formula that categorizes my data into different buckets. In the screenshot below, I have already successfully categorized the main component of the data, but I want to further break it down. I am trying to only change the values that include the word "Data". Sometimes it looks like ContractedData or COAMData in either the Current Group or Prev Group columns. For some reason I am getting an error for the formula (expected something between '(' and the CONTAINS keword). 

 

CASE WHEN "ACTIVATION CATEGORY" IN 'OTHER ACTIVATIONS' AND (CONTAINS("PREV_GROUP",'Data') OR CONTAINS("CURR_GROUP",'Data')) THEN 'OTHER ACTIVATIONS-DATA'
WHEN "ACTIVATION CATEGORY" IN 'NEGATIVE ACTIVATIONS' AND (CONTAINS("PREV_GROUP",'Data') OR CONTAINS("CURR_GROUP",'Data')) THEN 'NEGATIVE ACTIVATIONS-DATA'
WHEN "ACTIVATION CATEGORY" IN 'OTHER ACTIVATIONS-NO BILLINGS' AND (CONTAINS("PREV_GROUP",'Data') OR CONTAINS("CURR_GROUP",'Data')) THEN 'OTHER ACTIVATIONS-NO BILLINGS DATA'
ELSE "ACTIVATION CATEGORY"
END

 

 

2 REPLIES 2
Hammad_Rashid
11 - Bolide

CASE
WHEN "ACTIVATION CATEGORY" IN ('OTHER ACTIVATIONS') AND (CONTAINS([PREV_GROUP],'Data') OR CONTAINS([CURR_GROUP],'Data')) THEN 'OTHER ACTIVATIONS-DATA'
WHEN "ACTIVATION CATEGORY" IN ('NEGATIVE ACTIVATIONS') AND (CONTAINS([PREV_GROUP],'Data') OR CONTAINS([CURR_GROUP],'Data')) THEN 'NEGATIVE ACTIVATIONS-DATA'
WHEN "ACTIVATION CATEGORY" IN ('OTHER ACTIVATIONS-NO BILLINGS') AND (CONTAINS([PREV_GROUP],'Data') OR CONTAINS([CURR_GROUP],'Data')) THEN 'OTHER ACTIVATIONS-NO BILLINGS DATA'
ELSE "ACTIVATION CATEGORY"
END

OllieClarke
15 - Aurora
15 - Aurora

@maygross which database are you using?

Labels
Top Solution Authors