Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts ,
Need your help on below Data flagging range(LOW/MEDIUM/HIGH)
Data i have as input :
Tab 1:
LOAD * INLINE [
Country
OTHER
"OTHER,INDIA"
USA
UK
"UK,INDIA"
INDIA
"INDIA,USA"
BLANK
];
Types of Priority_risk as need:
INDIA--->LOW
UK------>MEDIUM
USA----->HIGH
OTHER--->HIGH
BLANK--->LOW
Expected output:
OTHER-------->HIGH
OTHER,INDIA-->HIGH
USA---------->HIGH
UK----------->MEDIUM
UK,INDIA----->MEDIUM
INDIA-------->LOW
INDIA,USA---->HIGH
BLANK-------->LOW
Note: If Priority_risk > 1 value (i.e some times country have more than one priority)THEN use the one with the highest risk
Ex:-(OTHER,INDIA-->HIGH).
Thanks,
Suresh V.V
May be this
MapTable:
Mapping
LOAD * Inline [
A,B
INDIA,1
UK,2
USA,3
OTHER,3
BLANK,1];
LOAD * Inline [
Priority,Risk
1,LOW
2,MEDIUM
3,HIGH];
Tab1:
LOAD Country,Max(Priority1) as Priority Group By Country;
LOAD Country,SubField(Priority,',') as Priority1,Priority;
LOAD *,MapSubString('MapTable',Country) as Priority INLINE [
Country
OTHER
"OTHER,INDIA"
USA
UK
"UK,INDIA"
INDIA
"INDIA,USA"
BLANK];
Hello!
You can use Index() function for searching some text within the string.
And you should use risk numeric indication, like 0 - low, 1 - medium, 2 - high. And after that you can pick the highest risk status using max() function and grouping.
May be this
MapTable:
Mapping
LOAD * Inline [
A,B
INDIA,1
UK,2
USA,3
OTHER,3
BLANK,1];
LOAD * Inline [
Priority,Risk
1,LOW
2,MEDIUM
3,HIGH];
Tab1:
LOAD Country,Max(Priority1) as Priority Group By Country;
LOAD Country,SubField(Priority,',') as Priority1,Priority;
LOAD *,MapSubString('MapTable',Country) as Priority INLINE [
Country
OTHER
"OTHER,INDIA"
USA
UK
"UK,INDIA"
INDIA
"INDIA,USA"
BLANK];
Hi,
Take a look at the attached app.
Mark
Thank You all for your valuble time
Thanks,
Suresh V.V