Build real-world financial dashboards, portfolio analytics, and automated reporting workflows using Haijun's Excel, PowerPoint, and PDF tracks.
š” Real-world Impact: These are the same Tracks that power Haijun Creates Files, enabling Haijun to create professional financial documents directly in the interface.
What you'll learn:
Automate multi-format reporting pipelines
Table of Contents
Portfolio Analytics Excel
Investment Committee Deck
Use Case 3: Automated Reporting Pipeline
Prerequisites
;financial"
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
DATA_DIR = Path.cwd().parent / "sample_data"
print("ā Environment configured")
print(f"ā Output directory: {OUTPUT_DIR}")
print(f"ā Data directory: {DATA_DIR}")
Load Financial Data
def format_financial_value(value, is_currency=True, decimals=0):
"""Format financial values for display."""
if is_currency:
return f"${value:,.{decimals}f}"
else:
return f"{value:,.{decimals}f}"
print("ā Helper functions defined")
2. Use Case 1: Financial Dashboard Creation
print("This creates a focused 2-sheet portfolio analysis optimized for the Tracks API.")
print("\nā±ļø Generation time: 1-2 minutes\n")
Prepare portfolio data for the prompt
top_holdings = portfolio_df.nlargest(5, "market_value")
sector_allocation = portfolio_data["sector_allocation"]
portfolio_excel_prompt = f"""
Create a portfolio analysis Excel workbook with 2 sheets:
Sheet 1 - "Portfolio Overview":
Create a comprehensive holdings and performance table:
Section 1 - Holdings (top of sheet):
{portfolio_df[["ticker", "name", "shares", "current_price", "market_value", "unrealized_gain", "allocation_percent"]].head(10).to_string()}
Section 2 - Portfolio Summary:
- Total portfolio value: ${portfolio_data["total_value"]:,.2f}
- Total unrealized gain: ${portfolio_df["unrealized_gain"].sum():,.2f}
- Total Return: {portfolio_data["performance_metrics"]["total_return_percent"]:.1f}%
- YTD Return: {portfolio_data["performance_metrics"]["year_to_date_return"]:.1f}%
- Sharpe Ratio: {portfolio_data["performance_metrics"]["sharpe_ratio"]:.2f}
- Portfolio Beta: {portfolio_data["performance_metrics"]["beta"]:.2f}
Apply conditional formatting: green for gains, red for losses.
Add a bar chart showing top 5 holdings by value.
Sheet 2 - "Sector Analysis & Risk":
Create sector allocation and risk metrics:
Section 1 - Sector Allocation:
{json.dumps(sector_allocation, indent=2)}
Include a pie chart of sector allocation.
Section 2 - Key Risk Metrics:
- Portfolio Beta: {portfolio_data["performance_metrics"]["beta"]:.2f}
- Standard Deviation: {portfolio_data["performance_metrics"]["standard_deviation"]:.1f}%
- Value at Risk (95%): $62,500
- Maximum Drawdown: -12.3%
- Sharpe Ratio: {portfolio_data["performance_metrics"]["sharpe_ratio"]:.2f}
Section 3 - Rebalancing Recommendations:
- Reduce Technology from 20% to 18%
- Increase Healthcare from 8.7% to 10%
- Maintain current diversification
Apply professional formatting with clear sections and headers.
"""
Create portfolio analysis Excel
portfolio_response, portfolio_results = create_skills_message(
client,
portfolio_excel_prompt,
[{"type": "juglow", "skill_id": "xlsx", "version": "latest"}],
prefix="portfolio_analysis_",
)
print("\n" + "=" * 60)
print_download_summary(portfolio_results)
if len(portfolio_results) > 0 and portfolio_results[0]["success"]:
print("\nā Portfolio analysis Excel created successfully!")