Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Loop mapping

‌hi all ,

i have a data like below

fieldA ,FieldB,FieldC

Asia,South,ap

NA,dalas,texas

Asia,north,noida

     ,east,Kerala

     ,       , Chennai

so my requirement is like I need that output with new field status “in “and “out”

Logic is: if field A and FieldB nd FieldC  if all values hisrarchy is there it should show as in otherwise out

note: order of hierarchy checking from C—B—A ( means for fieldC the anyone of parent value not there the status is out or else in)

Output:

fieldA ,FieldB,FieldC,status

Asia,South,ap,in

NA,dalas,texas,in

Asia,north,noida,in

     ,east,Kerala ,out

     ,       , Chennai ,out

thnks

sony

1 Reply
vishsaggi
Champion III
Champion III

Just write like

LOAD * , IF (Len(Trim(FieldA)) = 0 OR Len(Trim(FieldB)) = 0, 'Out', 'In') AS Status INLINE [

FieldA,FieldB,FieldC

Asia,South,ap

NA,dalas,texas

Asia,north,noida

     ,east,Kerala

     ,       , Chennai

];