Skip to content

Commit 5a7b100

Browse files
authored
Add 🍡 content to PSConfEU2024- Anh Tran πŸ‘’
1 parent cb95d7d commit 5a7b100

14 files changed

+706
-0
lines changed

β€ŽAnhTran/Data/asset_w24.xlsx

12.4 KB
Binary file not shown.

β€ŽAnhTran/Data/asset_w25.xlsx

12.4 KB
Binary file not shown.

β€ŽAnhTran/Data/estimation.csv

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ο»ΏAge_Group,Age_Count,Competitor,Substitute
2+
<= 22,100,0.3,0.5
3+
22-40,150,0.5,0.3
4+
40-60,200,0.3,0.65
5+
>=60,300,0.1,0.8

β€ŽAnhTran/Data/inventory.xlsx

10.8 KB
Binary file not shown.

β€ŽAnhTran/Data/operation_w25.xlsx

12.1 KB
Binary file not shown.
10.8 KB
Binary file not shown.

β€ŽAnhTran/Data/sales.csv

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
ο»ΏDate,Sales,Count_customers,Price,Weather,Traffic
2+
01/06/2023,259.35,117,3.99,1,1
3+
02/06/2023,275.31,58,3.99,0,1
4+
03/06/2023,239.4,120,3.99,1,0
5+
04/06/2023,339.15,153,3.99,1,1
6+
05/06/2023,383.04,85,3.99,0,1
7+
06/06/2023,331.17,83,3.99,0,0
8+
07/06/2023,574.56,278,3.99,1,1
9+
08/06/2023,422.94,106,3.99,0,0
10+
09/06/2023,195.51,98,3.99,1,0
11+
10/06/2023,347.13,174,3.99,1,0
12+
11/06/2023,375.06,75,3.99,0,1
13+
12/06/2023,566.58,284,3.99,1,0
14+
13/06/2023,331.17,74,3.99,0,1
15+
14/06/2023,442.89,111,3.99,0,0
16+
15/06/2023,590.52,148,3.99,0,0
17+
16/06/2023,255.36,56,3.99,0,1
18+
17/06/2023,379.05,95,3.99,0,0
19+
18/06/2023,171.57,86,3.99,1,0
20+
19/06/2023,534.66,134,3.99,0,0
21+
20/06/2023,578.55,272,3.99,1,1
22+
21/06/2023,399,200,3.99,1,0
23+
22/06/2023,343.14,66,3.99,0,1
24+
23/06/2023,542.64,129,3.99,0,1
25+
24/06/2023,263.34,132,3.99,1,0
26+
25/06/2023,339.15,85,3.99,0,0
27+
26/06/2023,494.76,248,3.99,1,0
28+
27/06/2023,399,100,3.99,0,0
29+
28/06/2023,179.55,45,3.99,0,0
30+
29/06/2023,363.09,182,3.99,1,0
31+
30/06/2023,399,194,3.99,1,1
32+
01/07/2023,279.3,124,3.99,1,1
33+
02/07/2023,267.33,126,3.99,1,1
34+
03/07/2023,406.98,192,3.99,1,1
35+
04/07/2023,379.05,173,3.99,1,1
36+
05/07/2023,466.83,234,3.99,1,0
37+
06/07/2023,454.86,104,3.99,0,1
38+
07/07/2023,570.57,286,3.99,1,0
39+
08/07/2023,327.18,73,3.99,0,1
40+
09/07/2023,199.5,50,3.99,0,0
41+
10/07/2023,478.8,110,3.99,0,1
42+
11/07/2023,538.65,135,3.99,0,0
43+
12/07/2023,562.59,132,3.99,0,1
44+
13/07/2023,343.14,86,3.99,0,0
45+
14/07/2023,363.09,91,3.99,0,0
46+
15/07/2023,227.43,96,3.99,1,1
47+
16/07/2023,534.66,123,3.99,0,1
48+
17/07/2023,355.11,171,3.99,1,1
49+
18/07/2023,231.42,51,3.99,0,1
50+
19/07/2023,267.33,67,3.99,0,0
51+
20/07/2023,590.52,296,3.99,1,0
52+
21/07/2023,422.94,204,3.99,1,1
53+
22/07/2023,331.17,69,3.99,0,1
54+
23/07/2023,171.57,67,3.99,1,1
55+
24/07/2023,371.07,84,3.99,0,1
56+
25/07/2023,574.56,144,3.99,0,0
57+
26/07/2023,335.16,159,3.99,1,1
58+
27/07/2023,387.03,80,3.99,0,1
59+
28/07/2023,383.04,192,3.99,1,0
60+
29/07/2023,383.04,88,3.99,0,1
61+
30/07/2023,574.56,144,3.99,0,0
62+
31/07/2023,442.89,210,3.99,1,1
63+
01/08/2023,482.79,233,3.99,1,1
64+
02/08/2023,422.94,106,3.99,0,0
65+
03/08/2023,371.07,186,3.99,1,0
66+
04/08/2023,311.22,150,3.99,1,1
67+
05/08/2023,339.15,170,3.99,1,0
68+
06/08/2023,586.53,147,3.99,0,0
69+
07/08/2023,223.44,56,3.99,0,0
70+
08/08/2023,187.53,47,3.99,0,0
71+
09/08/2023,582.54,285,3.99,1,1
72+
10/08/2023,562.59,122,3.99,0,1
73+
11/08/2023,502.74,252,3.99,1,0
74+
12/08/2023,502.74,115,3.99,0,1
75+
13/08/2023,446.88,224,3.99,1,0
76+
14/08/2023,590.52,280,3.99,1,1
77+
15/08/2023,207.48,32,3.99,0,1
78+
16/08/2023,450.87,226,3.99,1,0
79+
17/08/2023,239.4,47,3.99,0,1
80+
18/08/2023,387.03,194,3.99,1,0
81+
19/08/2023,518.7,130,3.99,0,0
82+
20/08/2023,307.23,154,3.99,1,0
83+
21/08/2023,518.7,113,3.99,0,1
84+
22/08/2023,482.79,121,3.99,0,0
85+
23/08/2023,307.23,154,3.99,1,0
86+
24/08/2023,359.1,80,3.99,0,1
87+
25/08/2023,494.76,248,3.99,1,0
88+
26/08/2023,211.47,106,3.99,1,0
89+
27/08/2023,171.57,33,3.99,0,1
90+
28/08/2023,287.28,144,3.99,1,0
91+
29/08/2023,295.26,74,3.99,0,0
92+
30/08/2023,331.17,152,3.99,1,1
93+
31/08/2023,474.81,238,3.99,1,0
94+
01/09/2023,363.09,176,3.99,1,1
95+
02/09/2023,287.28,72,3.99,0,0
96+
03/09/2023,267.33,67,3.99,0,0
97+
04/09/2023,566.58,129,3.99,0,1
98+
05/09/2023,578.55,145,3.99,0,0
99+
06/09/2023,434.91,94,3.99,0,1

β€ŽAnhTran/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Anh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

β€ŽAnhTran/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Leveraging PowerShell ImportExcel: Time Series Forecasting & Impact Estimation
2+
3+
This is the demo for the talk with title above at New York PowerShell Meetup on 16th November 2023 (Online).
4+
Link to the talk: https://www.youtube.com/watch?v=pkIRzLQ0_fs
5+
6+
## Abstract
7+
In this online talk presented at the New York PowerShell Meetup, we delve into the practical applications of the ImportExcel module in PowerShell through two illustrative examples. The first example explores time series forecasting, while the second focuses on impact estimation. The outcomes can be effectively visualized and shared with business stakeholders to facilitate informed decision-making. The ImportExcel module not only empowers business stakeholders to analyze and experiment with results easily but also provides a flexible setup for dynamic and efficient adjustments as needed.
8+
9+
## Usage Instructions
10+
This script is designed for live demonstrations and showcases different examples. For a smooth experience, it is recommended to run each part of the script separately. Detailed instructions for execution can be found in the corresponding YouTube video associated with this talk.
11+
12+
## Contributing
13+
If you'd like to contribute to this project, feel free to open an issue or submit a pull request.
14+
15+
## License
16+
This project is licensed under the MIT License.
17+
18+
## Note
19+
- Data is simulated
20+
- In case you are still interested in PowerShell and its super power, feel free to visit my blog post on 2 other articles related to using PowerShell for Email and Calendar Automation: https://analysiswithanh.medium.com
21+

β€ŽAnhTran/Result/estimation.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"Age_Group": "\u003c= 22",
4+
"Age_Count": "100",
5+
"Competitor": "0.3",
6+
"Substitute": "0.5"
7+
},
8+
{
9+
"Age_Group": "22-40",
10+
"Age_Count": "150",
11+
"Competitor": "0.5",
12+
"Substitute": "0.3"
13+
},
14+
{
15+
"Age_Group": "40-60",
16+
"Age_Count": "200",
17+
"Competitor": "0.3",
18+
"Substitute": "0.65"
19+
},
20+
{
21+
"Age_Group": "\u003e=60",
22+
"Age_Count": "300",
23+
"Competitor": "0.1",
24+
"Substitute": "0.8"
25+
}
26+
]

β€ŽAnhTran/Result/result.xlsx

48.1 KB
Binary file not shown.

β€ŽAnhTran/Script/psconf2024-init.ps1

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<#
2+
.SYNOPSIS
3+
This code is to automate the estimation and sales forecast
4+
5+
.DESCRIPTION
6+
It works by consolidating different excel files and performing calculation
7+
8+
9+
.NOTES
10+
DateUpdated: 2024-06-16
11+
Version: 1.0
12+
13+
14+
.EXAMPLE
15+
.\psconf2024-init.ps1
16+
This file contains all parameters needed to run the code
17+
#>
18+
19+
param(
20+
$result = "..\Result\result.xlsx",
21+
$inventory = "..\Data\inventory.xlsx",
22+
$operationFileName = "..\Data\operation_w.xlsx",
23+
$sales = "..\Data\sales.csv",
24+
$utilizationFileName = "..\Data\asset_w.xlsx",
25+
$estimation = "..\Data\estimation.csv"
26+
27+
)
28+
29+
#REPORTING TIME:
30+
$year = 2024
31+
Write-Output "Is The current YEAR correct? $year"
32+
$currentDate = Get-Date
33+
$calendar = [System.Globalization.CultureInfo]::CurrentCulture.Calendar
34+
$weekNumber = $calendar.GetWeekOfYear($currentDate, [System.Globalization.CalendarWeekRule]::FirstDay, [DayOfWeek]::Monday) -1
35+
$last_week_utilization = $utilizationFileName -replace '\.xlsx',"$($Weeknumber-1).xlsx"
36+
$this_week_utilization = $utilizationFileName -replace '\.xlsx',"$($Weeknumber).xlsx"
37+
$operation = $operationFileName -replace '\.xlsx',"$($Weeknumber).xlsx"
38+
# $Plan = $PlanFileName -replace '\.xlsx'," $($Weeknumber)-$($Weeknumber+1).xlsx"
39+
40+
Write-Output "Is The current WEEK correct? $weekNumber"
41+
42+
43+
#DELETE:
44+
$ws_delete_sheet = @("utilization", "utilization-new-hidden","operation","sales")
45+
$ws_delete_rows = "inventory"
46+
47+
48+
#utilization TABLE
49+
$utilizationStructure =
50+
@{ 'A1' = "Asset Type"},
51+
@{ 'B1' = "Asset Number"},
52+
@{ 'C1' = "Description"},
53+
@{ 'D1' = "Frequency"},
54+
@{ 'E1' = "Capacity"},
55+
@{ 'F1' = "Date_lastweek"},
56+
@{ 'G1' = "Reading_lastweek"},
57+
@{ 'H1' = "Date_thisweek"},
58+
@{ 'I1' = "Reading_thisweek"},
59+
@{ 'J1' = "utilization_lastweek"},
60+
@{ 'K1' = "utilization_thisweek"},
61+
@{ 'M1' = "Asset Type Summary"},
62+
@{ 'N1' = "Average utilization This Week"},
63+
@{ 'O1' = "Change in Average utilization"}
64+
65+
66+
#FREQUENCY:
67+
$frequency = "Hours"
68+
69+
# #COFFEE TYPE
70+
# $capcity = @{
71+
# @("Coconut Coffee") = ""
72+
# @("Durian Coffee") = ""
73+
# @("Egg York Coffee") = ""
74+
# @("Cheese Coffee") = ""
75+
# }
76+
77+
#CATEGORIES
78+
$categories = @{
79+
@("MC 11","MC 12","MC 13") = "Pour-Over Coffee Maker"
80+
@("MC 21","MC 22","MC 23") = "Espresso Coffee Maker"
81+
@("MC 31","MC 32","MC 33") = "All-in-One Coffee Maker"
82+
}
83+

0 commit comments

Comments
Β (0)