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: 
Not applicable

Create field and assign values

I have many rows of transactions and they are categorised by two fields; BOOK and SECTOR. However I need to further categorise each transaction using an extra field called PRODUCT, which is not present in the database.

The product can be inferred by what the SECTOR or BOOK is. For example if the BOOK is 'EURO SSA' i want to assign the a PRODUCT of '€ Agency bonds' or if the SECTOR is CROSSOVER then assign a PRODUCT of 'CDS HY'.

I am not connecting directly to the database, rather our Qlikview developers have given me a raw qvw from which I am loading the data. Therefore my question is, how do I script these rules which specify which PRODUCT values are assigned to each transaction?

13 Replies
tresesco
MVP
MVP

Then Rename your TRADES table (somewhere in the script you used before this section of script) as Trade_Temp, and then try like:

TRADE:

LOAD

*,

ApplyMap('MapProduct',DESK,ApplyMap('MapProduct',SECTOR, Null())) as PRODUCT

Resident Trade_Temp;

Drop Tables  Trade_Temp, Data ;

Not applicable
Author

I am doing a Binary load from another qvw and the TRADES table is in that.

Do i need to get the table renamed in the underlying qvw or can I do it in this one?

tresesco
MVP
MVP

You can simply rename(in this app itself) like:

Rename table TRADES to Trade_Temp;

Not applicable
Author

You guys are geniuses!!!!

That has worked perfectly. Thanks so much for your help