Skip to content

Commit

Permalink
machine.productivity_metrics: make resolution a drop down
Browse files Browse the repository at this point in the history
  • Loading branch information
denizs committed Sep 30, 2024
1 parent 9203b18 commit c06a2eb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Transforms.pqm
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,22 @@ let
expandedTable,
"productivity_metrics",
(row) =>
(start as datetimezone, end as datetimezone, resolution as text) =>
MachineProductivityMetrics(Table.FromRecords({row}), start, end, resolution)
let
functionSignature = type function (
start as datetimezone,
end as datetimezone,
resolution as (
type text meta [
Documentation.Label = "Resolution",
Documentation.Description = "Select a resolution.",
Documentation.AllowedValues = {"hourly", "daily", "weekly", "monthly"}
]
)
) as table,
func = (start as datetimezone, end as datetimezone, resolution as text) =>
MachineProductivityMetrics(Table.FromRecords({row}), start, end, resolution)
in
Value.ReplaceType(func, functionSignature)
)
in
Table.ChangeType(machinesWithMetrics, TableSchemas[MachinesTableSchema]),
Expand Down
3 changes: 3 additions & 0 deletions enlyze.pq.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildMez">
<PropertyGroup>
<Configuration>Debug</Configuration>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<OutputPath>$(MSBuildProjectDirectory)\bin\AnyCPU\Debug\</OutputPath>
<IntermediateOutputPath>$(MSBuildProjectDirectory)\obj\</IntermediateOutputPath>
Expand Down

0 comments on commit c06a2eb

Please sign in to comment.