Added join sales data example

This commit is contained in:
dfinke
2018-07-05 16:58:36 -04:00
parent fc4b1638da
commit e5841d76c6
5 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
"Region","Item","UnitSold","UnitCost"
"East","Banana","38","0.26"
"East","Kale","71","0.69"
"East","Apple","35","0.55"
"East","Potato","48","0.48"
"East","Kale","41","0.74"
1 Region Item UnitSold UnitCost
2 East Banana 38 0.26
3 East Kale 71 0.69
4 East Apple 35 0.55
5 East Potato 48 0.48
6 East Kale 41 0.74

View File

@@ -0,0 +1,22 @@
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
$xlfile = "$env:temp\AllSales.xlsx"
Remove-Item $xlfile -ErrorAction Ignore
$params = @{
AutoSize = $true
AutoFilter = $true
AutoNameRange = $true
ExcelChartDefinition = New-ExcelChartDefinition -XRange Item -YRange UnitSold -Title 'Units Sold'
Path = $xlfile
}
Import-Csv $PSScriptRoot\NorthSales.csv | Export-Excel -WorkSheetname North @params
Import-Csv $PSScriptRoot\EastSales.csv | Export-Excel -WorkSheetname East @params
Import-Csv $PSScriptRoot\SouthSales.csv | Export-Excel -WorkSheetname South @params
Import-Csv $PSScriptRoot\WestSales.csv | Export-Excel -WorkSheetname West @params
$params.Remove("AutoNameRange")
$params.Remove("ExcelChartDefinition")
Join-Worksheet -WorkSheetName AllSales -Show @params

View File

@@ -0,0 +1,5 @@
"Region","Item","UnitSold","UnitCost"
"North","Apple","40","0.68"
"North","Kale","55","0.35"
"North","Banana","33","0.31"
"North","Pear","29","0.74"
1 Region Item UnitSold UnitCost
2 North Apple 40 0.68
3 North Kale 55 0.35
4 North Banana 33 0.31
5 North Pear 29 0.74

View File

@@ -0,0 +1,6 @@
"Region","Item","UnitSold","UnitCost"
"South","Banana","54","0.46"
"South","Pear","39","0.44"
"South","Potato","33","0.46"
"South","Banana","49","0.31"
"South","Apple","38","0.59"
1 Region Item UnitSold UnitCost
2 South Banana 54 0.46
3 South Pear 39 0.44
4 South Potato 33 0.46
5 South Banana 49 0.31
6 South Apple 38 0.59

View File

@@ -0,0 +1,12 @@
"Region","Item","UnitSold","UnitCost"
"West","Banana","74","0.56"
"West","Apple","26","0.7"
"West","Banana","59","0.49"
"West","Potato","56","0.62"
"West","Banana","60","0.64"
"West","Pear","32","0.29"
"West","Apple","73","0.26"
"West","Banana","49","0.59"
"West","Pear","65","0.35"
"West","Apple","60","0.34"
"West","Kale","67","0.38"
1 Region Item UnitSold UnitCost
2 West Banana 74 0.56
3 West Apple 26 0.7
4 West Banana 59 0.49
5 West Potato 56 0.62
6 West Banana 60 0.64
7 West Pear 32 0.29
8 West Apple 73 0.26
9 West Banana 49 0.59
10 West Pear 65 0.35
11 West Apple 60 0.34
12 West Kale 67 0.38