mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Added join sales data example
This commit is contained in:
6
Examples/JoinWorksheet/EastSales.csv
Normal file
6
Examples/JoinWorksheet/EastSales.csv
Normal 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"
|
||||
|
22
Examples/JoinWorksheet/JoinSalesData.ps1
Normal file
22
Examples/JoinWorksheet/JoinSalesData.ps1
Normal 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
|
||||
5
Examples/JoinWorksheet/NorthSales.csv
Normal file
5
Examples/JoinWorksheet/NorthSales.csv
Normal 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"
|
||||
|
6
Examples/JoinWorksheet/SouthSales.csv
Normal file
6
Examples/JoinWorksheet/SouthSales.csv
Normal 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"
|
||||
|
12
Examples/JoinWorksheet/WestSales.csv
Normal file
12
Examples/JoinWorksheet/WestSales.csv
Normal 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"
|
||||
|
Reference in New Issue
Block a user