Forum Discussion
Using a function to tranform similar data tables
- 5 years ago
Hi Tom,
You haven't provided any of your queries so I hope I'm correctly understanding what you are trying to, it sounds like one of the things you are creating is a column with the total seconds from the times in the Time column?
If so you can create a custom column and use this formula to convert times that have a minute component.
= Table.AddColumn(PreviousStepname, "TotalSeconds", each Duration.TotalSeconds(Duration.FromText(Text.Insert([Time],0,"00:"))))To convert times without a minute component use this
= Table.AddColumn(PreviousStepName, "TotalSeconds", each Duration.TotalSeconds(Duration.FromText(Text.Insert([Time],0,"00:00:"))))So for this there isn't any need to write your own function(s). If you can supply your queries and explain the other things you are trying to do that you think a function might be needed, I can check to see if a custom function would make things easier, or if there's a way to achieve the result similar to above.
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Hi tomshaw83
Yes this could be done but without knowing the exact steps you are talking about it's difficult to say how to implement it. Can you post some sample PDF's and querys indicating the steps you want to turn into a function?
Cheers
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.