Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Freazord
Contributor
Contributor

Match value with another field's value

Hello,

I am creating a table where there is a list of accounts that can sometimes belong to a master account.

I have an 'Account Name' field, an 'Account ID' field and a 'Master Account ID' field, but I do not have a 'Master Account Name' field.

I want to create a table that displays an 'Account Name' column and a 'Master Account Name' column if an account is under a master account.

To help represent the problem, I am providing a small fictitious sample and images of what I would like to achieve.

The sample :

Freazord_5-1666858057927.png

What I have:

Freazord_4-1666857679301.png

What I would like to achieve :

Freazord_3-1666857651452.png

I tried to achieve this with this expression:

=If(match([ID Compte principal],[ID Compte]),[Nom Compte])

Unfortunately, it returns nothing

Do you have an idea?

 

Thanks in advance for the help

Labels (2)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

Hi @Freazord ,

You can use applymap function in script:

MTable:
Mapping Load
AccountID,
AccountName
from your_table;

NewTable:
load *,
applymap('MTable', [Master Account ID] ) as [Master Account Name]
from your_table;

I hope it can help.

Best Regards

View solution in original post

4 Replies
Mark_Little
Luminary
Luminary

HI @Freazord 

You can left join the data back

Left Join

 

Load

[Account ID] as [Master Account ID],

[Account Name]  as [Master Account Name]

Resident Table; //Table being the original table name

WHERE LEN(Master Account ID) > 0;

 

agigliotti
Partner - Champion
Partner - Champion

Hi @Freazord ,

You can use applymap function in script:

MTable:
Mapping Load
AccountID,
AccountName
from your_table;

NewTable:
load *,
applymap('MTable', [Master Account ID] ) as [Master Account Name]
from your_table;

I hope it can help.

Best Regards

Freazord
Contributor
Contributor
Author

Hello @agigliotti ,

Thank you for the solution. It works perfectly.

You made me discover an incredible function that is applymap.

Best Regards

Freazord
Contributor
Contributor
Author

Hello @Mark_Little ,

Unfortunately, I didn't manage to achieve what I wanted with the Left Join.

It may be that the error is on my end, but having tested the applymap solution that works, I didn't push your solution further.

I thank you for your help.

Best Regards