Oct 27 2022 06:44 PM
Hi,
I am unable to work out in power query how to add a step to calculate Column "Time-Copy.1" to have a column produce the "Required Result.
Hope somebody can help
Regards
Colin
Time-Copy.1 Required Result
12:29 PM 0
null 0
1:02 PM 0
null 0
1:37 PM Top2-2
Top-2 Top2-2
2:12 PM 0
null 0
2:47 PM 0
null 0
3:23PM Top-2
Top-2 Top-2
4:02 PM Top-2
Top-2 Top-2
4:42 PM Top-2
null 0
Oct 27 2022 09:45 PM
@Colin970 At a first glance it seems that you want the time stamp to show Top-2 if the row below it has Top-2 in it. But that logic fails for the 4:42 PM at the bottom as it should have 0, not Top-2. So please clarify.
Oct 27 2022 10:30 PM
Oct 27 2022 11:24 PM
Solution@Colin970 See attached. Created the query in PQ for the Mac. It has a slightly different set-up. That's why the initial steps look a bit different. Didn't bother to re-write the M-code.
Oct 27 2022 11:39 PM
@Colin970 Are you asking how you should add this to my sheet?
I assume you are somewhat familiar with PQ. Then you should be able to follow the applied steps in my file and create similar ones in your own file. Perhaps you can just copy most of them over directly. I can't tell without seeing your file.
Oct 27 2022 11:43 PM
Oct 28 2022 08:11 PM
Oct 28 2022 08:12 PM
Oct 28 2022 09:45 PM
@Colin970 Can you share a sample file via OneDrive or similar? Just remove anything confidential, as long as the structure/layout remains the same as your real file.
Oct 28 2022 09:59 PM
Oct 28 2022 10:33 PM
@Colin970 And now please explain what you've sent and where I should begin looking.
Oct 29 2022 12:39 PM
@Riny_van_Eekelen Hi yes I was not sure what to send you so I zipped all information. If you look at the spread sheet TAB 'TOP 2' that's where you will find the Query that I have been trying to update.. Hope this helps Regards Colin
Oct 30 2022 12:20 AM
@Colin970 Sorry, but this is simply too much to dive into. It would take half a day to figure out what you are doing and to make it work. Looked again what I had sent earlier and think it should be rather straight-forward to implement those few steps into your data set.
All it does is take the first column and adds two index columns. One starting at zero the other starting at one. The Merge and Expand steps put the information from "row 2" on to "row 1" and so on. Then the Added column "translates" that information to either a 0 or the word "Top-2".
Perhaps it would help if you started from scratch. Now, you have three attempts to get files from a folder and a lot of, what seem to be unnecessary steps, that just clutter the whole lot. I'm working on a powerful PC but my Excel hung-up after trying to reset the connection to the source files included in the zip-file. So, I gave up.
Oct 30 2022 12:48 AM