Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
I think in where clause you have to write the "exists".
Regards,
Chinna
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
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
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
Hi,
Mixmatch() also works in where clause for your case
where mixmatch(PROD.PROD_LN_ID,'PL1','PL2','PL3')
regards,
Chinna
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.
THank you every one .... implemented a mix of logics you described and it worked well...
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.