Power Query Transformation Questions.

scpournara

New Member
Joined
Aug 24, 2014
Messages
41
2 transformations I need to complete in Power Query.

1) I am appending multiple .cvs file. The source Name is "AvailableInventory - 08102020.cvs". I can not seem to Add column and extract the "08102020" and create a Date format? Can anyone help?

2) I have thousands of rows of data that express values in both FT and LBS. SAmple data looks like this: (25,645 LB, 10,000 FT, 31,500 LB). Imported the format is ABC 123. I can create new column for FT and LBS, but can not seem to create a new column with the number and change format to a whole number? Help?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I don't know how to do that with cvs file but I think it is possible with csv file ?
any small example of source data would help
 
Upvote 0
Thanks for looking at this. Here is an image.
 

Attachments

  • PQ.JPG
    PQ.JPG
    87 KB · Views: 6
Upvote 0
if you know how to use data from the picture I should congratulate you
anyway, pictures are useless
post a shared examples: csv file and excel file as source data and expected result. Use onedrive, googledrive, dropbox or any similar service

if data is classified - use generic data with the same structure
 
Upvote 0
adapt to you needs

Column1Column1Custom
02082020.csv0208202002/08/2020

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TBD = Table.TransformColumns(Source, {{"Column1", each Text.BeforeDelimiter(_, "."), type text}}),
    Text = Table.AddColumn(TBD, "Custom", each Text.Insert(Text.Insert([Column1],2,"/"),5,"/")),
    Parse = Table.TransformColumns(Text,{{"Custom", each Date.From(DateTimeZone.From(_)), type date}})
in
    Parse

for the second question I don't know what are you doing there ( no M, no live data so no correct answer ? )
 
Upvote 0
if you want to extract numbers only
Column1Column1Custom
28,800 FT28,800 FT28,800
-25,464 LB-25,464 LB-25,464

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TextSel = Table.AddColumn(Source, "Custom", each Text.Select([Column1],{"0".."9",",","-"}))
in
    TextSel
 
Upvote 0
Imho it should be like this
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table8"]}[Content],
    TextSel = Table.AddColumn(Source, "Custom", each Text.Select([Column1],{"0".."9","-"})),
    Type = Table.TransformColumnTypes(TextSel,{{"Custom", type number}})
in
    Type
Column1Custom
28,800 FT28800
-25,464 LB-25464
 
Upvote 0
Thank you very much for your help. I was able to redirect the pathname, open the data, and see how you built this query. Awesome!
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,196
Latest member
Maxkapoor

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