Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Some issues with mapping load and apply map function

Hello Team ,

There is some issues that i am coming across while trying to use the mapping load and apply map function.

I have a table which i am extracting from Vertica DB and there is a where condition in the end which says

WHERE PROD.PROD_LN_ID IN ('PL1','PL2','PL3','PL4','PL5','PL6','PL7','PL8','PL9');

once this is extracted i do a mapping load

Maptest:

mapping load distinct column1

PC_PL as cat_type

resident maintable

where match(upper(PROD.PROD_LN_ID),'PL1','PL2','PL3');

once this is completed i do an apply map query in my next table as below

applymap('Maptest',column1,'Print_PL') as category


however , though i have mentioned it to only pick specific PL's for PC_PL, it is picking additional PL's that are not PC_PL in the list as well


can you please tell me if this is incorrect or any other alternative that you can suggest

8 Replies
Anonymous
Not applicable
Author

Hi,

I think in where clause you have to write the "exists".

Regards,

Chinna

Not applicable
Author

Have you missed a comma here?

Maptest:

mapping load distinct column1 ,

PC_PL as cat_type

resident maintable

where match(upper(PROD.PROD_LN_ID),'PL1','PL2','PL3');

Thanks,

Singh

Anonymous
Not applicable
Author

Or you may write like this:

Maptest:

mapping load distinct column1,

PC_PL as cat_type

resident maintable

where upper(PROD.PROD_LN_ID) = ('PL1') or upper(PROD.PROD_LN_ID) = ('PL2') or upper(PROD.PROD_LN_ID) = ('PL3');


this is working. I hve just tested.


Regards,

Chinna

its_anandrjs
Champion III
Champion III

To check Mapping is work or not try to load data individually first then use it like mapping table and remove mapping key word.

Maptest:

load distinct column1

PC_PL as cat_type

resident maintable

where match(upper(PROD.PROD_LN_ID),'PL1','PL2','PL3');


Note:- by this only 'PL1','PL2','PL3' data loaded.


Regards

Anand

Anonymous
Not applicable
Author

Hi,

Mixmatch() also works in where clause for your case

where mixmatch(PROD.PROD_LN_ID,'PL1','PL2','PL3')

regards,

Chinna

jagan
Partner - Champion III
Partner - Champion III

Hi Ravi,

Check this script

Maptest:

mapping load distinct

     column1,

     PC_PL as cat_type

resident maintable

where Mixmatch(PROD.PROD_LN_ID, 'PL1','PL2','PL3') = 1;


Hope this helps you.


Regards,

jagan.

Not applicable
Author

THank you every one .... implemented a mix of logics you described and it worked well...

jagan
Partner - Champion III
Partner - Champion III

Hi,

Tried this simpler one

Maptest:

mapping load distinct

     column1,

     PC_PL as cat_type

resident maintable

where Mixmatch(PROD.PROD_LN_ID, 'PL1','PL2','PL3') = 1;


Regards,

Jagan.