Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
i got a situation: i have two tables and i am using the function: MapSubString ()
map2:
mapping LOAD * Inline
[ AttCode, Attribute
R, Red
C, Cotton
B, Blue
P, Polyester
L, Large];
Productmodels:
LOAD *,
MapSubString('map2', AttCode) as Description
Inline [
Model, AttCode
Twixie, R C R
Boomer, B P L
];
and final tables does look like:
Model Description
Twixie, Red Cotton Red
Boomer, Blue Polyester Large
if you see the Model: Twixie has 3 values in Description: Red, Cotton, Red,
it is possible to show only the distinct value, for instance: Twixie, Red, Contton ?
Does anybody have any idea?
Thanks a lot
Beck
Hi beck,
Try this,
map2:
mapping LOAD * Inline
[ AttCode, Attribute
R, Red
C, Cotton
B, Blue
P, Polyester
L, Large];
Master:
LOAD Model,MapSubString('map2', AttCode) as Description;
LOAD Model,Concat(distinct AttCode, ' ') as AttCode Group By Model;
LOAD Model,SubField(AttCode, ' ') as AttCode
Inline [
Model, AttCode
Twixie, R C R
Boomer, B P L
];
Hi, maybe with a middle step to split ain rows and remove duplicates:
CleanAttCode: LOAD Distinct *,SubField(AttCode, ' ') as Att Inline [ Model, AttCode Twixie, R C R Boomer, B P L ]; Productmodels: LOAD *, MapSubString('map2', AttCode) as Description; LOAD Model, Concat(Att, ' ') as AttCode Resident CleanAttCode Group By Model; DROP table CleanAttCode;
Hi Rubenmarin,
thanks a lot for your responce, but your suggestion does not work
Hi beck,
Try this,
map2:
mapping LOAD * Inline
[ AttCode, Attribute
R, Red
C, Cotton
B, Blue
P, Polyester
L, Large];
Master:
LOAD Model,MapSubString('map2', AttCode) as Description;
LOAD Model,Concat(distinct AttCode, ' ') as AttCode Group By Model;
LOAD Model,SubField(AttCode, ' ') as AttCode
Inline [
Model, AttCode
Twixie, R C R
Boomer, B P L
];
Thanks a lot for your help and feedback