Forum Discussion

DavidBlockAU's avatar
DavidBlockAU
New Member
6 years ago
Solved

Look up value in different row and return row in Query editor

I have done some searching and found a few posts close to what I'm after, but can't quite get the result I need! In particular, this was real close. 

 

I have a table like this (date format is DDMMYYYY):

JobNoStageIDTargetDateActualDate
1210001/01/202002/01/2020
1220007/01/202006/01/2020
1230014/01/202010/01/2020
1240031/01/202021/01/2020
2810003/01/202003/01/2020
2820005/01/202007/01/2020
2840015/01/202021/01/2020
2850020/01/202030/01/2020

 

I want to return the "Scheduled Start Date" for a particular job (being the target date where StageID = 100 for a job) in a separate column in query editor so my table will look something like this:

 

JobNoStageIDTargetDateActualDateStartDate
1210001/01/202002/01/202001/01/2020
1220007/01/202006/01/202001/01/2020
1230014/01/202010/01/202001/01/2020
1240031/01/202021/01/202001/01/2020
2810003/01/202003/01/202003/01/2020
2820005/01/202007/01/202003/01/2020
2840015/01/202021/01/202003/01/2020
2850020/01/202030/01/202003/01/2020

 

Any help would be much appreciated!

  • Hello DavidBlockAU,

    You can try the following steps:

    1. Create a duplicate of the table. Go to that duplicate table.

    2. Go to Transform > Group By. Enter JobNo as Grouping, New column name - 'StartDate', Operation - 'Min' & Column - 'TargetDate'. Click on OK.
    3. Go to the original table > Merge Queries. Merge original and duplicate table with JobNo column.

    4. Expand the column and select only 'StartDate. You will have your column.

     

    Hope this helps.

3 Replies