akazmi commited on
Commit
ade2f2b
·
verified ·
1 Parent(s): 22ac20e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
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
- # Visualization 4: Profit and Loss Overview (Simple Table)
137
- st.subheader("Profit and Loss Overview")
138
- pnl_data = filtered_df[['Customer Name', 'Product Name', 'Net Sales Value', 'Cost', 'Net Sales Value - Cost']]
139
- pnl_data.columns = ['Customer', 'Product', 'Sales', 'Cost', 'Profit']
140
- st.dataframe(pnl_data)
 
 
 
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")