Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
martynwb
Contributor III
Contributor III

Updating a field in a row

Hi,

I need to update a row in a table based on a lookup value. I've already go the lookup value and I'm just looking for the best way to update the field. 

I have this Host table.

Host:
LOAD
ID As QualysHostID,
IP As QualysHostIP,
TRACKING_METHOD As QualysHostTrckingMethod,
OS As QualysHostOS,
LAST_SCAN_DATETIME As QualysHostLastScanDateTime,
LAST_VM_SCANNED_DATE As QualysHostLastVMScanDate,
LAST_VM_SCANNED_DURATION As QualysHostLastVMScanDur,
DNS As QualysHostDNS,
OS_CPE As QualysHostOSCPE,
NETBIOS As QualysHostNetBios,
QG_HOSTID As QualysHostQGHostID,
LAST_VM_AUTH_SCANNED_DATE As QualysHostLastVMAuthScanDate,
LAST_VM_AUTH_SCANNED_DURATION As QualysHostLastVMAuthScannedDur,
"DNS_DATA/HOSTNAME" As QualysHostHostname,
"DNS_DATA/DOMAIN" As QualysHostDomain,
"DNS_DATA/FQDN" As QualysHostFQDN,
%Key_HOST_LIST_VM_DETECTION_OUTPUT_087173C108D6BD52,
%Key_HOST_312E40B6043C9FFE,
'' as SubDivision
FROM [lib://Qualys/Newdetection_*withTag.xml]
(XmlSimple, table is [HOST_LIST_VM_DETECTION_OUTPUT/RESPONSE/HOST_LIST/HOST]);

You'll note that I added an empty column to the load, which I'm expecting to populate having looked up the relevant value.

So, I now have a QualysHostID value and a value to place in the 'SubDivision' column. How can I do that most efficiently? It will operate within a loop and all Host entries will eventually be assigned a 'SubDivision' based on a reference table (that logic appears to be working already).

Your help is appreciated!

Qlik Sense Business 

1 Solution

Accepted Solutions
maxgro
MVP
MVP

2 Replies
maxgro
MVP
MVP

I think you can use a mapping table (lookup table) and ApplyMap function

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/Mapping...

 

martynwb
Contributor III
Contributor III
Author

Hi and thanks

So, would you advise that I build the mapping table and add one line at a time (concatenate) until I've looped through all values, then I applya map from the mapping table to the original qvd?

Martyn