Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on Applymap Statement

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)

1 Solution

Accepted Solutions
vidyut
Partner - Creator II
Partner - Creator II

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.


View solution in original post

8 Replies
Anonymous
Not applicable
Author

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

Not applicable
Author

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

Hi James,

I don't see anything wrong with your script. Will you be able to provide the Mapping Load QVD File?

Regards,

Vidyut

Not applicable
Author

Hi Vidyut

Mapping File is attached now.  thanks

vidyut
Partner - Creator II
Partner - Creator II

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

Not applicable
Author

the parent 547348 should linked to 32 child account vidyut

vidyut
Partner - Creator II
Partner - Creator II

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.


Not applicable
Author

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