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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anya
Contributor III
Contributor III

How to add new field

dear all, i have a table like this

noproductamount
skincare  
1cosrx2
2l'oreal2

 

how to process the data in qlik sense, so that it can display like this table .

no.productamounttype
1cosrx2skincare
2l'oreal2skincare

 please help me with the formula. Or give a fair idea about how to achieve this. 

thanks

4 Replies
prieper
Master II
Master II

give it a try with a scriptsolution:

Data:
 LOAD
  *,
  IF(LEN(TRIM(product)) = 0, no, Peek('type'))  AS type;
 LOAD
  *
 INLINE [no, product, amount
   skincare
   1, corsrx, 20
   2, loreal, 10
   abc
   3, asdlfk, 2
   2, asld, 10];

Data_clean:
 NOCONCATENATE LOAD
  *
 RESIDENT
  Data
 WHERE
  LEN(TRIM(product));  
  
DROP TABLE Data;    

 

HTH Peter

anya
Contributor III
Contributor III
Author

How about if the table as above is in Text form?

thanks a lot

prieper
Master II
Master II

just replace the INLINE-section with (wizard generated) corresponding load-sequence from Excel.

anya
Contributor III
Contributor III
Author

thank you