ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more 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
16 - Nebula
16 - Nebula

@maygross which database are you using?

Labels
Top Solution Authors