mktgtech commited on
Commit
62554a0
·
verified ·
1 Parent(s): 6e19e58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -126,33 +126,49 @@ def apply_business_logic(df):
126
  return df
127
 
128
  # =====================================================
129
- # 2. PRESETS
130
  # =====================================================
131
  DASHBOARD_PRESETS = {
 
132
  "Key Campaigns Bifurcation (MS Tech, Fintech, Adtech)": ("SPECIAL_KEY_BIFURCATION", None, None),
133
  "All Campaigns Performance": ("SPECIAL_ALL_PERFORMANCE", None, None),
 
 
134
  "Visits by Campaign": ("Campaign", "total_visits", "sum"),
135
  "Leads by Campaign": ("Campaign", "company_name", "count"),
136
  "Leads by Quality Group": ("Quality_Group", "company_name", "count"),
 
 
137
  "Visits by Country": ("country", "total_visits", "sum"),
138
  "Leads by Country": ("country", "company_name", "count"),
139
  "Visits by City": ("city", "total_visits", "sum"),
140
  "Leads by City": ("city", "company_name", "count"),
 
 
141
  "Visits by Industry": ("primary_industry", "total_visits", "sum"),
142
  "Leads by Industry": ("primary_industry", "company_name", "count"),
 
 
143
  "Top Accounts by Visits": ("company_name", "total_visits", "sum"),
144
  }
145
 
146
  TREND_PRESETS = {
 
147
  "Visits Trend by Campaign": ("total_visits", "sum", "Campaign"),
148
  "Leads Trend by Campaign": ("company_name", "count", "Campaign"),
149
  "Visits Trend by Quality": ("total_visits", "sum", "Quality_Group"),
 
 
150
  "Visits Trend by Country": ("total_visits", "sum", "country"),
151
  "Leads Trend by Country": ("company_name", "count", "country"),
152
  "Visits Trend by City": ("total_visits", "sum", "city"),
153
  "Leads Trend by City": ("company_name", "count", "city"),
 
 
154
  "Visits Trend by Industry": ("total_visits", "sum", "primary_industry"),
155
  "Leads Trend by Industry": ("company_name", "count", "primary_industry"),
 
 
156
  "Total Visits Trend": ("total_visits", "sum", None),
157
  "Active Accounts Trend": ("company_name", "count", None),
158
  }
 
126
  return df
127
 
128
  # =====================================================
129
+ # 2. PRESETS (UPDATED WITH COUNTRY/CITY/INDUSTRY)
130
  # =====================================================
131
  DASHBOARD_PRESETS = {
132
+ # -- SPECIAL VIEWS --
133
  "Key Campaigns Bifurcation (MS Tech, Fintech, Adtech)": ("SPECIAL_KEY_BIFURCATION", None, None),
134
  "All Campaigns Performance": ("SPECIAL_ALL_PERFORMANCE", None, None),
135
+
136
+ # -- CAMPAIGN & QUALITY --
137
  "Visits by Campaign": ("Campaign", "total_visits", "sum"),
138
  "Leads by Campaign": ("Campaign", "company_name", "count"),
139
  "Leads by Quality Group": ("Quality_Group", "company_name", "count"),
140
+
141
+ # -- GEOGRAPHY (NEW) --
142
  "Visits by Country": ("country", "total_visits", "sum"),
143
  "Leads by Country": ("country", "company_name", "count"),
144
  "Visits by City": ("city", "total_visits", "sum"),
145
  "Leads by City": ("city", "company_name", "count"),
146
+
147
+ # -- INDUSTRY (NEW) --
148
  "Visits by Industry": ("primary_industry", "total_visits", "sum"),
149
  "Leads by Industry": ("primary_industry", "company_name", "count"),
150
+
151
+ # -- OTHERS --
152
  "Top Accounts by Visits": ("company_name", "total_visits", "sum"),
153
  }
154
 
155
  TREND_PRESETS = {
156
+ # -- CAMPAIGN & QUALITY --
157
  "Visits Trend by Campaign": ("total_visits", "sum", "Campaign"),
158
  "Leads Trend by Campaign": ("company_name", "count", "Campaign"),
159
  "Visits Trend by Quality": ("total_visits", "sum", "Quality_Group"),
160
+
161
+ # -- GEOGRAPHY (NEW) --
162
  "Visits Trend by Country": ("total_visits", "sum", "country"),
163
  "Leads Trend by Country": ("company_name", "count", "country"),
164
  "Visits Trend by City": ("total_visits", "sum", "city"),
165
  "Leads Trend by City": ("company_name", "count", "city"),
166
+
167
+ # -- INDUSTRY (NEW) --
168
  "Visits Trend by Industry": ("total_visits", "sum", "primary_industry"),
169
  "Leads Trend by Industry": ("company_name", "count", "primary_industry"),
170
+
171
+ # -- GENERAL --
172
  "Total Visits Trend": ("total_visits", "sum", None),
173
  "Active Accounts Trend": ("company_name", "count", None),
174
  }