mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 07:43:23 +00:00
Improved
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
function Invoke-Sum {
|
function Invoke-Sum {
|
||||||
param($data,$dimension,$measure)
|
param(
|
||||||
|
$data,
|
||||||
|
$dimension,
|
||||||
|
$measure
|
||||||
|
)
|
||||||
|
|
||||||
|
if(!$measure) {$measure = $dimension}
|
||||||
|
|
||||||
$h=@{}
|
$h=@{}
|
||||||
|
|
||||||
@@ -8,7 +14,11 @@ function Invoke-Sum {
|
|||||||
|
|
||||||
if(!$key) {$key="[missing]"}
|
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()){
|
foreach ($entry in $h.GetEnumerator()){
|
||||||
@@ -17,5 +27,4 @@ function Invoke-Sum {
|
|||||||
$measure=$entry.value
|
$measure=$entry.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user