Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
In my requirement i have more table which are have two fields table to avoid more joins i am applying APPLY MAP function but i am getting wrong data.
present have wrote logic like below :
STATUS:
Mapping
LOAD
aEnumID,
UPPER(tDisplayName) as T_status
FROM
DB1;
colorcode:
LOAD
aEnumID,
ApplyMap('STATUS',aEnumID) as T_status,
nID,
color_displayname as colorcode
From
DB2;
using this i am getting aEnumID values only , my intention is to get the T_status value .
if any one know how to get this please give me suggestion.
Hi,
Your script looks okay. You may not be having matching aEnumID in DB2 table. Try to load both table individually and see if you are getting any matching aEnumID.
Satya
Your script is OK just check your data and then cross check the values, for understanding see the small example
STATUS:
Mapping LOAD * Inline
[
aEnumID,T_status
1,A
2,B
3,C
4,D
5,E
6,F
];
colorcode:
LOAD ApplyMap('STATUS',aEnumID) as T_status,aEnumID;
LOAD * Inline
[
aEnumID
1,
2,
3,
4,
5,
6,
];
if you comment two lines and reload you can see what happens
the 2 tables should be associated by aEnumID
make a str table chart with aEnumID and T_status
STATUS:
//Mapping comment this
LOAD
aEnumID,
UPPER(tDisplayName) as T_status
FROM
DB1;
colorcode:
LOAD
aEnumID,
//ApplyMap('STATUS',aEnumID) as T_status, comment this
nID,
color_displayname as colorcode
From
DB2;
Hi anand chouhan,
We have checked the data both table aEnumID value is same but i am using the apply map i am not get the T_status value again , i am getting the T_status field , once if i take T_status list box it shows aEnumID values, can you guide me how to approach this.
Hi Massimo Grossi,
here we have more table have like this if i use join condition system will be showing virtual memory error to avoid this i am using apply map please give me any suggestion.
Hi Satyadev Jaiswal,
I have checked both are same aEnumid values, while using applyamap i am getting T_status field but in that field i am getting aEnumid values only, if you have any suggestion please give me on this.
See my example and do the mapping like that also try with this script of line and add 'Unknown' and check what you get.
ApplyMap('STATUS',aEnumID,'Unknown') as T_status,aEnumID;
Hi,
Can you use Upper(Trim(aEnumID)) in both the loading and see if there is still an issue. The fastest way to resolve your issue is to have a clear idea on your data, if possible send us some sample data for analysis.
Satya
Hi,
Is aEnumid is a numeric field, if not then convert this to Upper(aEnumid) in both the tables and check it again. If still it is not working then try using Lookup() in script. Check below thread for Lookup example.
Regards,
Jagan.