Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to map a value from an inline table but I want to get only left substring of the mapping value.
Example:
Part | Val|Country |
A | 3|India |
B | 4|USA |
C | 5|Russia |
D | 6|Germany |
I want to map Part A using apply map function to only Val field value (3).
Similarly, for B I want to get 4 and so on.
Can someone let me know how to achieve this?
Thanks,
May be this
SubField(ApplyMap('MappingTableName', Part, Null()), '|', 1) as ....
you can use the left function. it would be Left(Val|Country, 1)
this should return most character in the field, which is what you're looking for
here is the syntax: Left(text, count )
may be change your mapping load
Map_table:
Mapping Load
Part
SubField([Val|Country],'|',1) as Val
From your table;
Hey Please find the below scripts,
Data:
Mapping Load Part,SubField(Val|Country,'|',1) AS Country Inline [
Part,Val|Country
A,3|India
B,4|USA
C,5|Russia
D,6|Germany
E,67|UK];
FactData:
Load ApplyMap('Data',Part) as 'Mapping Country',* Inline [
Part,Ratio
A,33
B,44
C,55
D,65
E,68];
OP