Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to change the content of my field based on three conditions:
-if contains '_AB' change to AB,
-if contains '_CD' change to CD,
-others leave as it is.
Where is my error in the following code? Thank you in advance!!!
LOAD
NAME,
IF(WILDMATCH(NAME, '*_AB*'),'AB', NAME
and WildMatch(NAME, '*_CD*'), 'CD', NAME) as NewField
FROM [lib://SAMPLE/Mappe1.xlsx]
(ooxml, embedded labels, table is Tabelle1);
best,
Rustam
try with
LOAD
NAME,
IF(Wildmatch(NAME, '*_AB*')>0, Replace(NAME, '_AB', 'AB'),
IF(Wildmatch(NAME, '*_CD*')>0, Replace(NAME, '_CD', 'CD'),
NAME
)
) as NewField
FROM [lib://SAMPLE/Mappe1.xlsx]
(ooxml, embedded labels, table is Tabelle1);
Try like,
=subfield(text('_AB'),'_',2) as Field
Hi Alessandro,
Tx! I tried it but, there is no content like PC, or AC in my Field. The orginal code below???
LOAD
NAME,
IF(WILDMATCH(NAME, '*_PC*')>0, Replace(NAME,'_PC', 'PC'),
IF(WildMatch(NAME, '*_AC')>0, Replace(NAME, '_AC', 'AC'),
NAME)) as NewField
FROM [lib://MAN/Mappe1.xlsx]
(ooxml, embedded labels, table is Tabelle1);
Hi Harshal,
tx for reply! How do I get the other 'CD', other case here?
best,
Rustam
the code you have written should work ...
I see the problem, it is just changing the content
from for eg. _PC to PC,
Orginal:
12_PC=> 12PC,
But I want to change the Name of the cell of a field,
Example
12_PC => PC
13_AC => AC
123_C => 123_C
How do go about it ?
Tx in advance!!!
LOAD
NAME,
subfield(NAME),'_',2) as NewField
FROM SOURCE;
please let me know any single name fieldvalue example...
Hi rustam ,
may be you want like this,
A:
load subfield(name,'_',2) as New_Nmae inline [
name
12_PC
13_AC
123_C
];
I tried this,
it is working only for PC, but not for AC.
why???
@harshal, there are many cells like content of the field, I did not get how I could do with your code???
tx you all!
LOAD
NAME,
IF(WILDMATCH(NAME, '*_PC*')>0, 'PC',
IF(WildMatch(NAME, '*_AC')>0, 'AC',
NAME)) as NewField
FROM [lib://MAN/Mappe1.xlsx]
(ooxml, embedded labels, table is Tabelle1);