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

Conditional statement

Hi2023
8 - Asteroid

Hi I need help with correction to my conditional statement.

 

I need to it make sure it calculates correctly for each catefory and doesnt fall within another category and doesnt have duplicates within results

 

IF [DG10Count]>1 THEN "DS"+"-"+[Dup_System_10] ELSEIF
[DG9Count]>1 AND [STATUS] IN ("", "Open") THEN "DS"+"-"+[Dup_System_09] ELSEIF [DG8Count]>1 THEN "PS"+"-"+[Dup_System_08] ELSE "NO DUP" ENDIF

 

I am getting NO DUP for duplicates for DG9 and also duplicates within the output of DG9

 

does this format look ok?

 

thanks

 

 

 

 

9 REPLIES 9
Luke_C
17 - Castor
17 - Castor

Hi @Hi2023 

 

The syntax looks fine, can you attach some sample data that illustrates the problem along with your expected output?

binuacs
21 - Polaris

@Hi2023 I think the condition checking for an empty string might be causing the issue. Can you try the below formula

 

IF [DG10Count] > 1 THEN "DS-"+[Dup_System_10] 
ELSEIF [DG9Count] > 1 AND isEmpty(Trim([STATUS])) AND  [STATUS] = "Open" THEN "DS-"+[Dup_System_09] 
ELSEIF [DG8Count] > 1 THEN "PS-"+[Dup_System_08] 
ELSE "NO DUP" 
ENDIF

 

Hi2023
8 - Asteroid

thanks but now DG09 is all blank?

Luke_C
17 - Castor
17 - Castor

@Hi2023 Can you provide sample data? Very difficult to troubleshoot otherwise.

Hi2023
8 - Asteroid

SO, I THINK I AM GOING TO SEPARATE IT ALL OUT AND USE A SUMMARY TOOL & JOIN TO BRING ALL BACK

 

SHOULDNT IT BE :

 

IF [DG10Count]>1 THEN "PS"+"-"+[Dup_System_10] ELSE ENDIF 

 

IT WONT LET ME CLOSE OUT THE STATEMENT -IT STATES MALFORMED?

 

THANKS

Luke_C
17 - Castor
17 - Castor

@Hi2023 Your else statement is empty. Try the below (or substitute Null() ) as needed. 

 

IF [DG10Count]>1 THEN "PS"+"-"+[Dup_System_10] ELSE NULL() ENDIF 

Hi2023
8 - Asteroid

OH YA! LOL

 

THANKSSS

Hi2023
8 - Asteroid

DISREGARD

Hi2023
8 - Asteroid

.

Labels
Top Solution Authors