Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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
Hi
I like sorting this in the load script using the Nullasvalue() in the load script :
SET NullValue = '<Null>';
NullAsValue [YourField] ;
Best Regards, Bill
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
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
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
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,
Hi
Could elaborate on "without success" ?
Posting a sample qvw using an Inline Load for your sample would help.
Best Regards, Bill
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
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
];
Could you share what the error during the reload is ?
And past in your load script ?
Best Regards, Bill