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: 
vanderson009
Creator III
Creator III

ApplyMap Issue in Qlik Sense

I have following script, I have created mapping table to map M_STATUS against SYSTEM field from Table2 but i am not able to map it.

Please let me know if their is any wrong with script.

M_STATUS:

Mapping

Load      'AB' as SYSTEM

               M_STATUS

FROM Table1;

DATAMODEL:

Load    *, Applymap('M_STATUS',SYSTEM,null()) as STATUS;

Load     VENDOR,

             PO_ORDER,

             'AB' as SYSTEM            

FROM Table2;

Thanks,

Villyee.

11 Replies
Chanty4u
MVP
MVP

what error you are getting?

vanderson009
Creator III
Creator III
Author

In final Data Model STATUS field showing empty value.

YoussefBelloum
Champion
Champion

Hi,

did you verify that there 'AB' value(s) on SYSTEM field on table 2 ?

Chanty4u
MVP
MVP

could you pelase share sample data?

vanderson009
Creator III
Creator III
Author

I am inserting  'AB' as SYSTEM with other fields.

YoussefBelloum
Champion
Champion

Like chanty already said, I would suggest you sharing sample data from table1 and table2

OmarBenSalem

Maybe the M_STATUS and SYSTEM fields don't have the same data type; try to surround both of them with text()

marc_behrens
Partner - Contributor III
Partner - Contributor III

The thing is:

you are adding 'AB' as SYSTEM in each row of table 2.

Since there is no sample data, I assume your Table1 does have more than 1 row. BUT you are also adding 'AB' to each row. It should look like this I guess:

SYSTEM, M_STATUS

AB, 1

AB, 2

AB, 3

... and so on

The problem is, that each row in Table2 contains SYSTEM = 'AB'. It is impossible for qlik to apply the correct mapping, because Table1 contains more than one M_STATUS for AB. So instead of mapping multiple values Qlik will automatically pick the first occurrence). As we don't know the contents of your mapping table, we can't tell you what is apllied.

Kind regards,

Marc

P.S. If you want further advice, you should specify what you want to do, how your data looks like and add an example.

kaanerisen
Creator III
Creator III

Hi Marc,

It should be not a problem for qlik. Applymap function fetches the first matched record's value even there is multiple same value on the first column of mapping table. The reason should be different.


Untitled.png


Untitled2.png


vanderson009‌ If you can share a sample data, you can get more useful help from community