Setting up a specific output based on List Data

Gkr1981

New Member
Joined
Feb 9, 2010
Messages
46
Hi All,

I have some list data, that I need to get exported into a specific format.

The list format contains multiple columns all of which are not populated.

Here is an example of the data

MachineMonthDateShiftCrewActivity 1Activity 2LocationCodePROD 1PROD 2
DL1April
01/04/2020​
DA
1​
5​
BCMPABG Pit44505333
6436.571429​
0​
DL1April
01/04/2020​
DA
3​
CTONABG Pit
44505343​
0​
6000​

This is truncated by the way.

What I need to do is create another sheet which arranges this data in the following way

ActivityMachineMeasureDateD/NCrewFigure


However the data needs to look like this, so we can import it into a specific database table.

ActivityMachineMeasureDateD/NCrewFigure
44505333DL1Activity 11/04/2020DA1
44505333DL1Activity 201/04/2020DA5
44505333DL1PROD 101/04/2020DA6436.57
44505343DL1Activity 201/04/2020DA3
44505343DL1PROD 201/04/2020DA6000


I have reduced the number of columns and just using Activity 1 / 2 (it goes up to 35 activity numbers) and there are 10 Prod numbers.

However, trying to do a Pivot Table doesn't bring it back in the format we require.

What is the best method to convert the data from the initial list format into the second style of list format?

Any assistance or guidance on what would be the best way forward to convert the data into the required format? Please note also there is a large number of pieces of equipment etc, so a table like this with predetermined fields would not be sustainable and new codes are changed daily.

Any assistance would be appreciated.

Cheers
Graeme
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
if this is representative example try Power Query
any.png

Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    UOSC = Table.Unpivot(Source, {"Activity 1", "Activity 2", "PROD 1", "PROD 2"}, "Attribute", "Value"),
    TSC = Table.SelectColumns(UOSC,{"Code", "Machine", "Attribute", "Date", "Shift", "Crew", "Value"}),
    ParseDate = Table.TransformColumns(TSC,{{"Date", each Date.From(DateTimeZone.From(_)), type date}}),
    Type = Table.TransformColumnTypes(ParseDate,{{"Value", type number}}),
    Ren = Table.RenameColumns(Type,{{"Code", "Activity"}, {"Attribute", "Measure"}, {"Shift", "D/N"}, {"Value", "Figure"}}),
    Filter = Table.SelectRows(Ren, each ([Figure] <> 0))
in
    Filter
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,375
Members
448,955
Latest member
BatCoder

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top