Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,11 +133,14 @@ if not filtered_df.empty:
|
|
| 133 |
fig_year_trend = px.line(year_trend, x='Year', y='Net Sales Value', title='Year-over-Year Sales Trend')
|
| 134 |
st.plotly_chart(fig_year_trend)
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
| 141 |
|
| 142 |
# Visualization 5: Gross Margin Distribution (Pie chart)
|
| 143 |
st.subheader("Gross Margin Distribution")
|
|
|
|
| 133 |
fig_year_trend = px.line(year_trend, x='Year', y='Net Sales Value', title='Year-over-Year Sales Trend')
|
| 134 |
st.plotly_chart(fig_year_trend)
|
| 135 |
|
| 136 |
+
Add 'Net Sales Value - Cost' as a new column
|
| 137 |
+
filtered_df['Net Sales Value - Cost'] = filtered_df['Net Sales Value'] - filtered_df['Cost']
|
| 138 |
+
|
| 139 |
+
# Visualization 4: Profit and Loss Overview (Simple Table)
|
| 140 |
+
st.subheader("Profit and Loss Overview")
|
| 141 |
+
pnl_data = filtered_df[['Customer Name', 'Product Name', 'Net Sales Value', 'Cost', 'Net Sales Value - Cost']]
|
| 142 |
+
pnl_data.columns = ['Customer', 'Product', 'Sales', 'Cost', 'Profit']
|
| 143 |
+
st.dataframe(pnl_data)
|
| 144 |
|
| 145 |
# Visualization 5: Gross Margin Distribution (Pie chart)
|
| 146 |
st.subheader("Gross Margin Distribution")
|