Alteryx Designer Desktop Discussions

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

multiple condition if

rohini
8 - Asteroid

hi all,

 

I have certain condition if those coloumns fulfill those the Approval type remapped should be  a certain case. In the below table the if shows the conditions that the data should fulfill map the Approval type.

 

I tried out different combinations of IF and IIF but still not getting the desired result.

 

Attaching the data set below.

 

 

ifshould be
Rule no:Vehicle ManufacturerClaim KeyApproval typeApproval Sub TypeApproval type remapped
1BMW, MiniMBMW%, MK1MW%BMW BMW-Scheme
2BMW, MiniMBMW%, MK1MW% B%BMW-Scheme
3BMW, Mininot (MBMW% or MK1MW%)BMW BMW-Non Scheme
4BMW, Mininot (MBMW% or MK1MW%) B%BMW-Non Scheme

 

 

Data Set

Vehicle Manufacturer Nameclaim keyApproval TypeApproval Sub TypeApproval type remapped
MINIbmw1234No Approval Type SpecifiedB 
FORDMK1MW456No Approval Type SpecifiedG 
MACE assessmentMBMW4553No Approval Type SpecifiedD 
BMWjfklellmNo Approval Type SpecifiedB 
VAUXHALL (NEW)flnelkfnm1451No Approval Type SpecifiedE 
BMWnkenkfn175No Approval Type SpecifiedB 
LANDROVERnkdn,425No Approval Type SpecifiedB 
MINIm1256.MBMWNo Approval Type SpecifiedB 

 

 

Regards

Rohini

3 REPLIES 3
RolandSchubert
16 - Nebula
16 - Nebula

Hi @rohini ,

 

I think it should be:

 

IF [Vehicle Manufacturer Name] IN('BMW', 'MINI') THEN

IF [claim key] IN ('MBMW%', 'MK1MW%') THEN

IF [Approval Type] = 'BMW' THEN
'BMW-Scheme'
ELSEIF [Approval Sub Type] = 'B%' THEN
'BMW-Scheme'
ELSE
[Approval Type]
ENDIF

ELSE

IF [Approval Type] = 'BMW' THEN
'BMW-Non Scheme'
ELSEIF [Approval Sub Type] = 'B%' THEN
'BMW-Non Scheme'
ELSE
[Approval Type]
ENDIF

ENDIF

ELSE
[Approval type remapped] = [Approval Type]
ENDIF

 

Does this work?

 

Best,

 

Roland

terry10
12 - Quasar

Hi Rohini,

 

This IF statement works - see attached workflow.

 

IF ([Vehicle Manufacturer Name] = 'BMW' OR [Vehicle Manufacturer Name] = 'MINI' )
AND (StartsWith([claim key], "MBMW") OR StartsWith([claim key], "MK1MW") )
AND ([Approval Type]='BMW' OR  StartsWith([Approval Sub Type], "B"))
THEN "BMW-SCHEME"
ELSEIF ([Vehicle Manufacturer Name] = 'BMW' OR [Vehicle Manufacturer Name] = 'MINI' )
AND !(StartsWith([claim key], "MBMW") OR StartsWith([claim key], "MK1MW") )
AND ([Approval Type]='BMW' OR  StartsWith([Approval Sub Type], "B"))
THEN "BMW-NON SCHEME"
ELSE ""
ENDIF

 

Some of the challenges getting this to work:

  • (1) none of the original data met the criteria for BMW-SCHEME, so I added two test rows
  • (2) mixed case - so I upper-cased all the data using the Data Cleansing tool
  • (3) because the Approval Type Remapped was empty in the original dataset, it defaulted to a Boolean value, so I used the Select tool to change the data type.

I hope this solution helps you with what you are trying to achieve!

 

terry10

rohini
8 - Asteroid

Thank you Terri.

 

Made some changes. changed starts with to contains

Labels