Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
prahlad_infy
Partner - Creator II
Partner - Creator II

How to fetch Field Value Based on another field value within same column ?

Hi Experts ,

In a table there is a field (field1)  which has one of the field value , let say Juno . This field value (Juno) is present in multiple rows .

So my requirement is  to fetch all the field value which is immediate next to field value Juno and create two different table .

 

Fetch Field Value Based on another field value within same column.PNG

Thank You All .

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Table1:
load *,if(wildmatch(peek(field1),'juno'),field1,null()) as JUNO_ALL Inline [
field1
ABC
TVC
JUNO
client1
pqr
ppm
juno
dax
juno
rexx
];


Left Keep(Table1)
Table2:
load *,rowno() as rowno Inline [
JUNO_ALL
ABC
TVC
JUNO
client1
pqr
ppm
juno
dax
juno
rexx
]
Where Exists(JUNO_ALL);

drop field JUNO_ALL from Table1;

Table3:
load JUNO_ALL as JUNO_FIRST Resident Table2
Where rowno=1;


exit Script;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

Table1:
load *,if(wildmatch(peek(field1),'juno'),field1,null()) as JUNO_ALL Inline [
field1
ABC
TVC
JUNO
client1
pqr
ppm
juno
dax
juno
rexx
];


Left Keep(Table1)
Table2:
load *,rowno() as rowno Inline [
JUNO_ALL
ABC
TVC
JUNO
client1
pqr
ppm
juno
dax
juno
rexx
]
Where Exists(JUNO_ALL);

drop field JUNO_ALL from Table1;

Table3:
load JUNO_ALL as JUNO_FIRST Resident Table2
Where rowno=1;


exit Script;

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Thank You vineet sir . 

Just one comment - JUNO_ALL  is hardcorded . In realtime this word can be anything . 

Had it been dynamic , that would have been complete .