KunaalNaik commited on
Commit
1cc7896
1 Parent(s): e1a882d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -4
app.py CHANGED
@@ -7,12 +7,26 @@ st.set_page_config(layout="wide")
7
 
8
  st.title("CEO Dashboard")
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # Existing metric cards code
11
  col1, col2, col3, col4 = st.columns(4)
12
- col1.metric("Market Share", "14%", "1%")
13
- col2.metric("Revenue", "246971", "14%")
14
- col3.metric("Cost", "101500", "4%")
15
- col4.metric("Profit", "145471", "10%")
16
 
17
  # Fake data for the bar charts
18
  data1 = pd.DataFrame({
 
7
 
8
  st.title("CEO Dashboard")
9
 
10
+ # Get Information
11
+ df = pd.read_csv("CEO.csv")
12
+
13
+ # Get Numbers
14
+ kpi1_value = df['Overall Revenue Growth'].iloc[-1]
15
+ kpi2_value = df['Revenue'].iloc[-1]
16
+ kpi3_value = df['Cost'].iloc[-1]
17
+ kpi4_value = df['Profit'].iloc[-1]
18
+
19
+ kpi1_percentage = df['Overall Revenue Growth'].iloc[-1] - df['Overall Revenue Growth'].iloc[-2]
20
+ kpi2_percentage = df['Revenue'].iloc[-1]/df['Revenue'].iloc[-2]-1
21
+ kpi3_percentage = df['Cost'].iloc[-1]/df['Cost'].iloc[-2]-1
22
+ kpi4_percentage = df['Profit'].iloc[-1]/df['Profit'].iloc[-2]-1
23
+
24
  # Existing metric cards code
25
  col1, col2, col3, col4 = st.columns(4)
26
+ col1.metric("Market Share", kpi1_value, kpi1_percentage)
27
+ col2.metric("Revenue", kpi2_value, kpi1_percentage)
28
+ col3.metric("Cost", kpi3_value, kpi1_percentage)
29
+ col4.metric("Profit", kpi4_value, kpi1_percentage)
30
 
31
  # Fake data for the bar charts
32
  data1 = pd.DataFrame({