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??
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, MapSubString('map', value) as Value ;
SQL SELECT
interactivity_data_type_id,
value
FROM
rcdbprod.INTERACTIVITY_DATA
;
I can interpret your need into two different scenarios, choose one of them
based on your needs. I've added both adjustments to the script below.
1. Add a where clause to your SQL to limit which data you include into your
application.
2. Add an if statement around your mapping to limit which rows that should
have this logic.
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,
If(Interactivity_data_type_id= 3,MapSubString('map', value) )as Value
;
SQL SELECT
interactivity_data_type_id,
value
FROM
rcdbprod.INTERACTIVITY_DATA
WHERE
interactivity_data_type_id = 3
;You could include the 3 into the mapping key like in the solution below.
map:
mapping Load
'3|'& Value as Value,
New
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,
MapSubString('map', Interactivity_data_type_id &'|'& value) )as Value
;
SQL SELECT
interactivity_data_type_id,
value
FROM
rcdbprod.INTERACTIVITY_DATA
;