mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-11 13:53:20 +00:00
Improved
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
function Invoke-Sum {
|
||||
param($data,$dimension,$measure)
|
||||
param(
|
||||
$data,
|
||||
$dimension,
|
||||
$measure
|
||||
)
|
||||
|
||||
if(!$measure) {$measure = $dimension}
|
||||
|
||||
$h=@{}
|
||||
|
||||
@@ -8,7 +14,11 @@ function Invoke-Sum {
|
||||
|
||||
if(!$key) {$key="[missing]"}
|
||||
|
||||
$h.$key+=$item.$measure
|
||||
$value = $item.$measure
|
||||
if($value -is [string] -or $value -is [System.Enum]) {
|
||||
$value = 1
|
||||
}
|
||||
$h.$key+=$value
|
||||
}
|
||||
|
||||
foreach ($entry in $h.GetEnumerator()){
|
||||
@@ -17,5 +27,4 @@ function Invoke-Sum {
|
||||
$measure=$entry.value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user