Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi Community
I have a problem with an applymap statement as it's not applying the map for some reason and i am lost why it's not working hopefully you can help me
the code is as below:
//******************************************************************************** LOAD MAPPING TABLES ***********************************************************************************//
KACParentAccountDetails:
Mapping
LOAD CompanyDetails.CompanyCode,
CompanyDetails.AccountContractManagerName
FROM
C:\Users\Manager\Dropbox\Qlikview\KA\KACParentAccountDetails.qvd
(qvd);
//******************************************************************************** LOAD MAIN DATA TABLES ***********************************************************************************//
KAmaster:
LOAD CompanyDetails.CompanyID,
CompanyDetails.CompanyCode,
CompanyDetails.ParentAccountID,
Applymap('KACParentAccountDetails',CompanyDetails.ParentAccountID,'') as ContractManagerName,
CompanyDetails.AccountContractManagerName
FROM
C:\Users\Manager\Dropbox\Qlikview\KA\CompanyDetails.qvd
(qvd)
 
					
				
		
 vidyut
		
			vidyut
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi James,
Problem is with the ParentCompanyID, which is in Text Format instead of Number due to training spaces etc. So it you use
Applymap('KACParentAccountDetails',Num(Trim(CompanyDetails.ParentAccountID)), '') as ContractManagerName,
This should resolve your issue.
Hint: When you put a listbox for a field, the text is left aligned, and the numbers are right aligned.
 
					
				
		
James,
I don't see anyhting wrong with the script. Except, I recommend to use always mapping load distinct, except for inline load. If anything is wrong, it is likely with the data.
Regards,
Michael
 
					
				
		
Hi Michael
both CompanyDetails.ParentAccountID and CompanyDetails.CompanyCode are numerical fields, i have added a test app to this post if you need to see the data behind the code!
Regards
James
 
					
				
		
 vidyut
		
			vidyut
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi James,
I don't see anything wrong with your script. Will you be able to provide the Mapping Load QVD File?
Regards,
Vidyut
 
					
				
		
Hi Vidyut
Mapping File is attached now. thanks
 
					
				
		
 vidyut
		
			vidyut
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Now, Could you please find a Company in KAMaster with a Parent Company ID that is present in this Mapping QVD? That would help in resolving your issue.
Thanks,
Vidyut
 
					
				
		
the parent 547348 should linked to 32 child account vidyut
 
					
				
		
 vidyut
		
			vidyut
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi James,
Problem is with the ParentCompanyID, which is in Text Format instead of Number due to training spaces etc. So it you use
Applymap('KACParentAccountDetails',Num(Trim(CompanyDetails.ParentAccountID)), '') as ContractManagerName,
This should resolve your issue.
Hint: When you put a listbox for a field, the text is left aligned, and the numbers are right aligned.
 
					
				
		
Thanks Vidyut
so your converting the field to a number then using trim to remove all training spaces etc, you have been a great help
