Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
realpixel
Creator
Creator

Pick Wildmach null value

Hello,

I use the following expression

Pick(WildMatch([HMUSER2],'0','1','2','6'),'VIDES','ZU','ZP','ZL') as ZONE1 but I have some field that are blank.

I want to remplace blank value by 'VIDES', I try to use the value '0' or 'NULL' without succes.

Sommeon have an idea?

Labels (1)
1 Solution

Accepted Solutions
arbernardez_old
Partner - Contributor III
Partner - Contributor III

Hi,

can you try this one?


Pick(WildMatch(if(len(trim([HMUSER2]))=0,'0',[HMUSER2]),'0','1','2','6'),'VIDES','ZU','ZP','ZL') as ZONE1

or also this other one,

Pick(WildMatch([HMUSER2],'0','1','2','6')+1,'VIDES','VIDES','ZU','ZP','ZL') as ZONE1


also, if you are using this '0' value thinking in null, you just need to code

Pick(WildMatch([HMUSER2],'1','2','6')+1,'VIDES','ZU','ZP','ZL') as ZONE1


because wildmatch will return 0 when no value is found, then adding 1, will situate 0 into 1 and in pick function will be VIDES


Regards


Alberto Rodríguez

View solution in original post

11 Replies
Anonymous
Not applicable

Hi

I like sorting this in the load script using the Nullasvalue() in the load script :

SET NullValue = '<Null>';

NullAsValue [YourField] ;

Best Regards,     Bill

Jason_Michaelides
Partner - Master II
Partner - Master II

There's probably a better way but try:

If(IsNull(HMUSER2),'VIDES',

Pick(WildMatch([HMUSER2],'0','1','2','6'),'VIDES','ZU','ZP','ZL')) as ZONE1


Hope this helps,


Jason

Not applicable

Hi,

use the isnull() in the if() function

I like also the alt(arg1, arg2) function that returns the second argument when the 1st one is null

Fabrice

arbernardez_old
Partner - Contributor III
Partner - Contributor III

Hello,


sometimes empty value is not null, but you can easily find these blank fields with len(trim(x))=0

this should works, just take blank values and convert them to '0' to reach VIDES at pick function

Pick(WildMatch(if(len(trim([HMUSER2]))=0,'0',[HMUSER2]),'0','1','2','6'),'VIDES','ZU','ZP','ZL')) as ZONE1


Regards

realpixel
Creator
Creator
Author

Thank you for your reply.

I try this expression, without succes

SET NullValue = '<Null>';

NullAsValue [YourField] ;

And try also without succes

If(IsNull(HMUSER2),'VIDES',

Pick(WildMatch([HMUSER2],'0','1','2','6'),'VIDES','ZU','ZP','ZL')) as ZONE1

Is not possible to have something like that?

pick(WildMatch(If(IsNull([HMUSER2],'VIDES','1','2','6'),'VIDES','ZU','ZP','ZL') as ZONE1,

Anonymous
Not applicable

Hi

Could elaborate on "without success" ?

Posting a sample qvw using an Inline Load for your sample would help.

Best Regards,     Bill

arbernardez_old
Partner - Contributor III
Partner - Contributor III

Hi,

can you try this one?


Pick(WildMatch(if(len(trim([HMUSER2]))=0,'0',[HMUSER2]),'0','1','2','6'),'VIDES','ZU','ZP','ZL') as ZONE1

or also this other one,

Pick(WildMatch([HMUSER2],'0','1','2','6')+1,'VIDES','VIDES','ZU','ZP','ZL') as ZONE1


also, if you are using this '0' value thinking in null, you just need to code

Pick(WildMatch([HMUSER2],'1','2','6')+1,'VIDES','ZU','ZP','ZL') as ZONE1


because wildmatch will return 0 when no value is found, then adding 1, will situate 0 into 1 and in pick function will be VIDES


Regards


Alberto Rodríguez

realpixel
Creator
Creator
Author

I try but I have an error during the reload.

Pick(WildMatch(if(len(trim([HMUSER2]))=0,'0',[HMUSER2]),'0','1','2','6'),'VIDES','ZU','ZP','ZL')) as ZONE1

or also this other one,

Pick(WildMatch([HMUSER2],'0','1','2','6')+1,'VIDES','VIDES','ZU','ZP','ZL')) as ZONE1

I try also with inline command

It's works for value 1,2 and 6 but not for Null value

HMUSER2, ZONE
  1, ZU
  2, ZP
  6, ZL
<Null>,VIDES

];

Anonymous
Not applicable

Could you share what the error during the reload is ?

And past in your load script ?

Best Regards,     Bill