Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mapping load to calculate field in script

Hello,

I loaded my table "Host" from a Excel File Host.csv but some fields in this table have to be calculated in some conditions instead to be loaded directly from the file:

1/     The field Site of my table "Host" will takes the value of the field "Site_ShadowRouter" loaded in the table ShadowRouter  if the field host_type = "Agent" else it takes the value loaded from  the Excel file Host.csv :

  IF(Host[host_type] = "Agent"; ShadowRouter[Site_ShadowRouter]; Host[Site])

2/     The same for the field "site_code":

     IF(Host[host_type] = "Agent"; ShadowRoutert[SiteCode]); Host[site_code])


How can I do a mapping? there is no commun field between the tables Host and ShadowRouter!


There is my DataModel: (the table Host is linked to Data by the field host_key and the table ShadowRouter is linked to the table Data by the field Agent name)

modele de données.png

I really need your help!

Thanks

2 Replies
mohamed_ahid
Partner - Specialist
Partner - Specialist

Hello

still need some help ?

maxgro
MVP
MVP

This depends on the relations between the tables

There is my DataModel: (the table Host is linked to Data by the field host_key and the table ShadowRouter is linked to the table Data by the field Agent name)

left join (Data)

load [Agent name], Site_ShadowRouter as NewSite_ShadowRouter

resident ShadowRouter;

left join (Host)

load host_key, NewSite_ShadowRouter

resident Data;

but this should works if you have 1 shadow router for host_key, and I don't know if this is true.

You can do the same with a nested applymap

If you post a small example with your data we can try.