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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

very hard? please help..

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

4 Replies
johnw
Champion III
Champion III

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)

Not applicable
Author

it seams doesn't work 😞

johnw
Champion III
Champion III

Debugged version attached. It simply needed NOCONCATENATE in the Data load to avoid concatenating to RawData and subsequently being dropped.

Not applicable
Author

Many Tganks.

Now I trued the example in the "real problem".

Best Regards,

Slash

Ciao