Question

I have an Excel file with one column in it currently. This one column has two different fields which are ParentID and ChildID. All ChildID fields are located beneath its parent. Also, the ChildID fields are No Color, while the ParentID fields are green. I need to move these ChildID fields into Column B. I want them to remain on the same row, however, so that they easily map to their ParentID fields.

Also, I have all of the ParentID fields stored in a SQL table. How can I achieve this?

Was it helpful?

Solution

Copy your list to ColumnA in a blank sheet. Filter the copy by colour. Put =A2 in B2 (or adjust as necessary) and copy down. Copy the entire column, Paste Special Values next to your source data (move one row if required). Filter your source data on the added column to select non blanks. Blank out the cells in your original column. Unfilter.

OTHER TIPS

I actually came up with a SQL solution!

select 
CASE WHEN a1.F1 like '%.rdl%' 
then a1.F1
else NULL END as 'Report Name',
CASE WHEN rtrim(a2.F1) like '%.rdl%'
then ''
else a1.F1
END as 'Procedure'
from dbo.[all] a1
left join dbo.[all] a2 on a1.F1 = a2.F1 and a1.F1 like '%.rdl%' 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top