Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using apply map for error exception

hi i am using the following apply map statement for catching errors;

mission to see if the Item number i am loading from table 2 is exists in table 1 if yest then 'correct', if not then throw an error with text,' incorrect'.

however i only receive 'correct' although i know there is an item in Table2 that does not exist in Table1 - Item.

the apply map statement looks like this and i would like to see that for Item A200 there should be a flag saying incorrect in the layout.

if have attached my document  below;

LOAD

if(ApplyMap('Table1',Item,'Error') ='error','incorrect data','correct data') as ErrorflagField;

Table1:

LOAD * INLINE [

    Item

   A100

    B200

    C300

];

Table2:

Load * INLINE [

Item, Amount

A200, 100

B200, 200

C300, 300

];

Best

Brad

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Bradley

For your ApplyMap you need to have previous created the mapping table with a Mapping Load, see below.

Table1:

Mapping

LOAD * INLINE [

    CheckItem, BB

    A100, A100

    B200, B200

    C300, C300

];

Table2:

load

if(ApplyMap('Table1',Item,'Error') ='Error','incorrect data','correct data') as ErrorflagField ,

*

;

Load * INLINE [

Item, Amount

A200, 100

B200, 200

C300, 300

];

Best Regards,     Bil

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Bradley

For your ApplyMap you need to have previous created the mapping table with a Mapping Load, see below.

Table1:

Mapping

LOAD * INLINE [

    CheckItem, BB

    A100, A100

    B200, B200

    C300, C300

];

Table2:

load

if(ApplyMap('Table1',Item,'Error') ='Error','incorrect data','correct data') as ErrorflagField ,

*

;

Load * INLINE [

Item, Amount

A200, 100

B200, 200

C300, 300

];

Best Regards,     Bil

swuehl
MVP
MVP

Please check the Help file for applymap() function, you need to create a mapping table using MAPPING LOAD before you call applymap.