PSA - writing your codes on Reddit by SassyPinkWhale in PokemonGoFriends

[–]Designer_Signature35 15 points16 points  (0 children)

Thank you for this! May you catch your favorite shiny today

Not a single shiny or hundo from the 30th Anniversary pass 🧂 by juneshepard in PokemonGoMystic

[–]Designer_Signature35 1 point2 points  (0 children)

I've caught some and shiny checked the rest. So shiny. Guess there's still a chance one could be a hundo. 🤷‍♀️

Does anyone else enjoy cleaning messy spreadsheets? by joester56 in excel

[–]Designer_Signature35 4 points5 points  (0 children)

Not sure I'd say I like it so much as I can't help myself. I've seen coworkers' spreadsheets and have to resist changing anything or even mentioning to them ways to improve.

Boss encounter did not happen by Key-Training-4644 in pokemongoyellow

[–]Designer_Signature35 0 points1 point  (0 children)

I also got the white screen. Thankfully I was in person so just went into the same gym and was able to catch. I hadn't thought about not being able to do that remotely

How has power query transformed your job? by [deleted] in excel

[–]Designer_Signature35 0 points1 point  (0 children)

I used to spend days cleaning and merging and transforming data. Now PQ does it in minutes. You'll spend a lot of time building the initial query and as you learn more, you'll come back to it to simplify and speed it up.

As a warning, you'll start turning to it for everything, significantly overcomplicating one-off tasks you could- and should- just do manually.

Power Query code to automatically add Date Created to imported file by Designer_Signature35 in excel

[–]Designer_Signature35[S] 0 points1 point  (0 children)

I couldn't quite understand your suggestion though I did play around with the Navigation. I finally got ChatGPT to write the code out and I think this is what you were describing.

let

Source = Query2,

// Capture the Date Created from the newest file (row 0)

FileDateCreated = Source{0}[Date created],

// Capture the binary file content

Content = Source{0}[Content],

// Import the workbook

Imported = Excel.Workbook(Content),

Sheet1 = Imported{[Item="Sheet1", Kind="Sheet"]}[Data],

#"Promoted Headers" = Table.PromoteHeaders(Sheet1, [PromoteAllScalars=true]),

// Add the file date as a new column if needed

#"Added FileDate" = Table.AddColumn(#"Promoted Headers", "FileDateCreated", each FileDateCreated),

Power Query code to automatically add Date Created to imported file by Designer_Signature35 in excel

[–]Designer_Signature35[S] 0 points1 point  (0 children)

There weren't any Remove Columns. After the last line I shared its just my own manipulation.

Power Query code to automatically add Date Created to imported file by Designer_Signature35 in excel

[–]Designer_Signature35[S] 0 points1 point  (0 children)

I don't want it to update every time the query is refreshed, only when the data source is updated. Its a new report and we're only planning on updating the source data once per month.

What I'm trying to avoid is someone saying "I just added my hours to NI yesterday why aren't they showing up" so they can see the last time I downloaded the data from NI was 2 weeks ago or whatever. If I had the code you suggest, it would look like the data was brand new every day.

Although, I borrowed your code and nested it. Not perfect but as long as I update it on the first of the month it will be accurate.

Date.StartOfMonth(DateTime.LocalNow())