Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
consider this table. In ths case I would to replace
the cmp field where the cmp =fg
If the type of cmp is = fg I have to serach in the column
item and I must to replace the, in this sample, ccd eith j
becouse ccd= j in the column item
load * Inline [
item , vmp, type
abc , ccd , fg
abc , a , rm
abc , k , rm
ccd , j , rm
];
Some genius could to try to help me?
Thanks
best regards,
Slash
Perhaps this:
RawData:
load * Inline [
item , vmp, type
abc , ccd , fg
abc , a , rm
abc , k , rm
ccd , j , rm
];
Map:
MAPPING LOAD
item as vmp
,only(vmp) as newvmp
RESIDENT RawData
GROUP BY item
;
Data:
NOCONCATENATE LOAD
item
,if(type='fg' and len(applymap('Map',vmp)),applymap('Map',vmp),vmp) as vmp
,type
RESIDENT RawData
;
DROP TABLE RawData
;
I'm sure there would also be a way to do it with a bunch of joins without adding additional tables if memory usage during the load is a concern.
(Edit: added NOCONCATENATE)
it seams doesn't work 😞
Debugged version attached. It simply needed NOCONCATENATE in the Data load to avoid concatenating to RawData and subsequently being dropped.
Many Tganks.
Now I trued the example in the "real problem".
Best Regards,
Slash
Ciao