Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Add new fields

IF(WILDMATCH([Model],'*GTR-X 230*'), ' Playful' ) as [Riding Style]

The expression above states if the [Model] field contains ‘*GTR-X 230*’ then create a new field named [Riding Style] with the contents ‘Playful’

I want to modify it so that if the [Model] field contains ‘*GTR-X 230*’ then create 6 new fields named

[Riding Style] with contents ‘Playful’

[Seating] with contents ‘1’

[Riding Time] with contents ‘Short’

[Water Type] with contents ‘Mostly Flat’

[Speed] with contents ‘Very’

[Two Sports] with contents ‘Rarely’

 

Can you help?

3 Replies
lblumenfeld
Partner Ambassador
Partner Ambassador

You could simply repeat the WildMatch statement for each field. What do you want to do when the [Model] field doesn't contain ‘*GTR-X 230*’? That would help us answer the question.

Anonymous
Not applicable
Author

Can someone help, I want to consolidate 6 separate expressions into one?

 

IF(WILDMATCH([Model],'*GTR-X 230*'), ' Playful' ) as [Riding Style]

The expression above states if the [Model] field contains ‘*GTR-X 230*’ then create a new field named [Riding Style] with the contents ‘Playful’

I want to modify it so that if the [Model] field contains ‘*GTR-X 230*’ then create 6 new fields named

[Riding Style] with contents ‘Playful’

[Seating] with contents ‘1’

[Riding Time] with contents ‘Short’

[Water Type] with contents ‘Mostly Flat’

[Speed] with contents ‘Very’

[Two Sports] with contents ‘Rarely’

lblumenfeld
Partner Ambassador
Partner Ambassador

If the model is not ‘*GTR-X 230*’ then what do you want to do. In other words, do you load this data only for that wildmatch, otherwise you don't load it, or do you only load some (other) fields, or those fields with another value? This will determine what your load statement needs to look like.