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

Change value of dimension on load if matching a set value

Hi,

I am trying to change the value of a field on load if a value is equal to a set value:

i have tried like this 

if(wildmatch([Supplier], 'TABC//212'), 'TABC') as [Supplier],

or

if(([Supplier]= 'TABC//212'), 'TABC') as [Supplier],

 

In these cases the change happens where this is matched 'TABC//212' and gives a '-' for all other [Supplier].

How can i leave all [Supplier] as their original value other than if the wildmatch clause or =  to  is met please?

Thanks

 

Daniel

Labels (2)
2 Solutions

Accepted Solutions
Or
MVP
MVP

if(([Supplier]= 'TABC//212'), 'TABC',[Supplier]) as [Supplier]

If(Condition,Then,Else)

View solution in original post

Or
MVP
MVP

if([Supplier]= 'TABC//212', 'TABC',

if([Supplier]='J122RTS', 'JRTS',

[Supplier])) as [Supplier]

Should work, I believe.

View solution in original post

5 Replies
Or
MVP
MVP

if(([Supplier]= 'TABC//212'), 'TABC',[Supplier]) as [Supplier]

If(Condition,Then,Else)

davyqliks
Specialist
Specialist
Author

Ahhh,

Schoolboy error. Got it!

Thanks so much for the quick reply. Much appreciated .

 

Thank you

 

Daniel

davyqliks
Specialist
Specialist
Author

Hi again,

If i wanted to add a second value to this, another supplier to change the name also,

how would i achieve please. I try this:

if(([Supplier] = 'TABC//212'), 'TABC') ,
if (([Supplier]= 'J122RTS'), 'JRTS',[Supplier]) as [Supplier],

But the first value (TABC//212) now does not change.

 

How can i add to this please?

Thanks again in advance for your help

 

 

Or
MVP
MVP

if([Supplier]= 'TABC//212', 'TABC',

if([Supplier]='J122RTS', 'JRTS',

[Supplier])) as [Supplier]

Should work, I believe.

davyqliks
Specialist
Specialist
Author

Thanks again,

worked a treat, some out of place brackets were throwing it out for me.

 

Thank you so much.

Regards


Daniel