Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Calculate a measure based on different column

Hi, I have a scenario as below - 

City Closest1 Qty
A B 10.5
B A 20.3

 

I want to add a new column named Closest1_Qty which tells me about the Quantity for the Closest1 City as follows - 

City Closest1 Qty Closest1_Qty
A B 10 20.3
B A 20 10.5

 

please help me in creating that new column.

 

1 Reply
MayilVahanan

Hi

Try in script,

ClosestCity:
Mapping
LOAD * INLINE [
Closest1, Qty
B, 10.5
A, 20.3
];


LOAD *, ApplyMap('ClosestCity', City) as ClosestQty INLINE [
City, Closest1, Qty
A, B, 10.5
B, A, 20.3
];

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.