Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Antoine553
Contributor II
Contributor II

Update rows with another by key and dates

Hello

I'm having a list a payment that i imported from Excel looking  a little bit like this:

IDNameJobpriceDate
1John DoeMagician4012/06/2019
2Will SmithActor3211/05/2019
3John DoeSorcerer3620/06/2019
4Jack SparrowPirate2232/13/5899
5John Doe-1210/07/2019

 

I'm displaying it in a straight table. Sometimes the job might be missing. How can i complete the empty "Job" field by the last registered job for John Doe (Sorcerer) pls ?

Labels (3)
1 Solution

Accepted Solutions
PriyankaShivhare
Creator II
Creator II

PriyankaShivhare_0-1603197838329.png

Set NullInterpret = '';
Test:
Load ID,
Name,
Job,
price,
Date#(Date,'DD/MM/YYYY') as Date

inline [
ID ,Name ,Job ,price ,Date
1, John Doe, Magician, 40, 12/06/2019
2, Will Smith, Actor, 32 ,11/05/2019
3, John Doe, Sorcerer, 36, 20/06/2019
4, Jack Sparrow, Pirate, 22, 30/12/2015
5, John Doe ,, 12, 10/07/2019];


NoConcatenate
Test1:
Load ID,
Name,
Job,
price,
Date,
if(Name=peek(Name)and isnull(Job),peek(Job1),Job) as Job1
resident Test
order by Name,Date
;

drop table Test;

 

hope this helps

 

Thanks,

Priyanka Shivhare

View solution in original post

1 Reply
PriyankaShivhare
Creator II
Creator II

PriyankaShivhare_0-1603197838329.png

Set NullInterpret = '';
Test:
Load ID,
Name,
Job,
price,
Date#(Date,'DD/MM/YYYY') as Date

inline [
ID ,Name ,Job ,price ,Date
1, John Doe, Magician, 40, 12/06/2019
2, Will Smith, Actor, 32 ,11/05/2019
3, John Doe, Sorcerer, 36, 20/06/2019
4, Jack Sparrow, Pirate, 22, 30/12/2015
5, John Doe ,, 12, 10/07/2019];


NoConcatenate
Test1:
Load ID,
Name,
Job,
price,
Date,
if(Name=peek(Name)and isnull(Job),peek(Job1),Job) as Job1
resident Test
order by Name,Date
;

drop table Test;

 

hope this helps

 

Thanks,

Priyanka Shivhare