Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a database where the values will be stored as the numeric values in one interactivity_data_type_id(3).
Interactivity_data_type_id | Value |
1 | Abc |
2 | Def |
3 | 4,3,2 |
4 | Xyz |
5 | mno |
|
|
For those numeric value text are as below.
1-Specific(Not Realistic)
2-Realistic(Not Specific)
3- Both Specific and Realistic
4-Not Specific or Realistic
Now I want to display the relevant text for those numeric value s below.
Interactivity_data_type_id | Value |
1 | Abc |
2 | Def |
3 | Not Specific or Realistic, Both Specific and Realistic, Realistic(Not Specific) |
4 | Xyz |
5 | mno |
|
|
Kindly help me in displaying as above.. Can I do in front end ? If possible how can I do that??
He're the logic behind it:
map:
mapping Load * Inline
[
Value,New
1,Specific(Not Realistic)
2,Realistic(Not Specific)
3, Both Specific and Realistic
4,Not Specific or Realistic
];
Table:
load Interactivity_data_type_id,Concat(ApplyMap('map',Value),',') as Value Group by Interactivity_data_type_id
;
load Interactivity_data_type_id, SubField(Value,'-') as Value //In ur case SubField(Value,',') Inline [
Interactivity_data_type_id,Value
1,Abc
2,Def
3,4-3-2
4,Xyz
5,mno
];
Result
if u had an ID 6 with value 4,2 , u don't want to apply this logic??
if that is the case:
map:
mapping Load * Inline
[
Value,New
1,Specific(Not Realistic)
2,Realistic(Not Specific)
3, Both Specific and Realistic
4,Not Specific or Realistic
];
Table:
load Interactivity_data_type_id, SubField(Value,'-') as Value Inline [
Interactivity_data_type_id,Value
1,Abc
2,Def
3,4-3-2
4,Xyz
5,mno
6, 4-2
];
Finale:
NoConcatenate
load Interactivity_data_type_id,Concat(ApplyMap('map',Value),',') as Value Resident Table Where Interactivity_data_type_id=3 Group by Interactivity_data_type_id
;
load Interactivity_data_type_id, concat(Value,',') as Value Resident Table Where Interactivity_data_type_id<>3 Group by Interactivity_data_type_id;
drop Table Table;
result:
That's not what I've done.
Please try to EXACTLY recreate what I've done.