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: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Multiple source Data

I have a field named Supplier.

The value in Supplier is coming from table A and another mapping table.

I want to create a field named table source where I can identify from which table my values are coming.

Please help me in achieving this.

Below is my second source of data and the other is a straight table - 

ApplyMap('Map_Supplier',[Item]&'|'&Company_Code,[Supplier_001]) as [Supplier]

Labels (1)
1 Reply
Angela_Zhou
Contributor III
Contributor III

Assume you are trying to create a new filed called "TableSource" in your Final Table, which pull all data into one final table, you can try below to create Final filed [Supplier] from both TableA and Map, and create new filed [TableSource] using same if-else logic.  

TableFinal:
Load
if(Len(Supplier)>0, Supplier, ApplyMap('Map_Supplier',[Item]&'|'&Company_Code,[Supplier_001], null()) as [Supplier],

if(Len(Supplier)>0, 'TableA',
     if(Len(ApplyMap('Map_Supplier',[Item]&'|'&Company_Code,[Supplier_001], null())>0,'Map_Supplier','Unknown')
  ) AS [TableSource],

...
Resident TableA_or_JoinAllTable;

Please node, I use null() as DefaultValue when no matching fund in function ApplyMap('map', KeyToFindMach, DefaultValue).  Then Len(NULL) = 0 to mark as 'Unknow' Supplier, if any key <[Item]&'|'&Company_Code> has no match in TableA and Map.

 

Angela Z.