Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
the following expression give me only 1 result "AMB", while don't show me "LAB".
If([@4:9]=001880,'DIALISI', If(WildMatch([@10:17],'L*'),'LAB', If(Len(Trim([@10:17]>0)), If([@4:9]=030357,'PS_AMB','AMB')))) as TIPO
Please, someone can help me?
Thanks,
Mattia
May be try this
If([@4:9] = '001880', 'DIALISI',
If(WildMatch([@10:17], 'L*'), 'LAB',
If(Len(Trim([@10:17]))>0,
If([@4:9] = '030357', 'PS_AMB', 'AMB')))) as TIPO
Not sure why it doesn't work for you... but it seems to work for me... Sample script
Table:
LOAD *,
If(Field1 = '001880', 'DIALISI',
If(WildMatch(Field2, 'L*'), 'LAB',
If(Len(Trim(Field2))>0,
If(Field1 = '030357', 'PS_AMB', 'AMB')))) as TIPO;
LOAD * INLINE [
Field1, Field2
001880, HSKJS
193829, LHDSH
001880, LDFHS
030357, EHFSH
030357, LDHFS
030357,
];
Here Field1 = [@4:9] and Field2 = [@10:17]
and this is what I get
May be try this
If([@4:9] = '001880', 'DIALISI',
If(WildMatch([@10:17], 'L*'), 'LAB',
If(Len(Trim([@10:17]))>0,
If([@4:9] = '030357', 'PS_AMB', 'AMB')))) as TIPO
Hi Sunny,
unfortunately, the script don't run anyway.
Do you have another suggest?
Thank you so much,
Mattia
What error message do you get when you run this?
Excuse me Sunny, i misspoke.
The script runs but the value of the field "TIPO" is only "AMB", altough i've values in the table that match the expression: If(WildMatch([@10:17],'L*'),'LAB'
If can help you, if i hidd the last expression If(Len(Trim([@10:17]))>0, If([@4:9] = '030357', 'PS_AMB' , 'AMB', the value of the field "TIPO" is LAB.
Not sure why it doesn't work for you... but it seems to work for me... Sample script
Table:
LOAD *,
If(Field1 = '001880', 'DIALISI',
If(WildMatch(Field2, 'L*'), 'LAB',
If(Len(Trim(Field2))>0,
If(Field1 = '030357', 'PS_AMB', 'AMB')))) as TIPO;
LOAD * INLINE [
Field1, Field2
001880, HSKJS
193829, LHDSH
001880, LDFHS
030357, EHFSH
030357, LDHFS
030357,
];
Here Field1 = [@4:9] and Field2 = [@10:17]
and this is what I get
Sorry, Sunny.
It works perfectly.
Mattia