Spaces:
Sleeping
Sleeping
Commit
·
a80e545
1
Parent(s):
468877a
chore: Display transformed tables
Browse files
app.py
CHANGED
|
@@ -119,7 +119,7 @@ def _(DataFrame, ENGINE, run_queries):
|
|
| 119 |
|
| 120 |
@app.cell
|
| 121 |
def _(mo):
|
| 122 |
-
mo.md(r"""
|
| 123 |
return
|
| 124 |
|
| 125 |
|
|
@@ -130,6 +130,136 @@ def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
|
| 130 |
return
|
| 131 |
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
@app.cell
|
| 134 |
def _():
|
| 135 |
return
|
|
|
|
| 119 |
|
| 120 |
@app.cell
|
| 121 |
def _(mo):
|
| 122 |
+
mo.md(r"""**A. Revenue by Month and Year**""")
|
| 123 |
return
|
| 124 |
|
| 125 |
|
|
|
|
| 130 |
return
|
| 131 |
|
| 132 |
|
| 133 |
+
@app.cell
|
| 134 |
+
def _(mo):
|
| 135 |
+
mo.md(r"""**B. Top 10 Revenue by categories**""")
|
| 136 |
+
return
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
@app.cell
|
| 140 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 141 |
+
top_10_revenue_categories = query_results[
|
| 142 |
+
QueryEnum.TOP_10_REVENUE_CATEGORIES.value
|
| 143 |
+
]
|
| 144 |
+
top_10_revenue_categories
|
| 145 |
+
return
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
@app.cell
|
| 149 |
+
def _(mo):
|
| 150 |
+
mo.md(r"""**C. Top 10 Least Revenue by Categories**""")
|
| 151 |
+
return
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
@app.cell
|
| 155 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 156 |
+
top_10_least_revenue_categories = query_results[
|
| 157 |
+
QueryEnum.TOP_10_LEAST_REVENUE_CATEGORIES.value
|
| 158 |
+
]
|
| 159 |
+
top_10_least_revenue_categories
|
| 160 |
+
return
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
@app.cell
|
| 164 |
+
def _(mo):
|
| 165 |
+
mo.md(r"""**D. Revenue per State**""")
|
| 166 |
+
return
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
@app.cell
|
| 170 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 171 |
+
revenue_per_state = query_results[QueryEnum.REVENUE_PER_STATE.value]
|
| 172 |
+
revenue_per_state
|
| 173 |
+
return
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
@app.cell
|
| 177 |
+
def _(mo):
|
| 178 |
+
mo.md(r"""**E. Delivery Date Difference**""")
|
| 179 |
+
return
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
@app.cell
|
| 183 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 184 |
+
delivery_date_difference = query_results[
|
| 185 |
+
QueryEnum.DELIVERY_DATE_DIFFERENCE.value
|
| 186 |
+
]
|
| 187 |
+
delivery_date_difference
|
| 188 |
+
return
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
@app.cell
|
| 192 |
+
def _(mo):
|
| 193 |
+
mo.md(r"""**F. Real vs. Predicted Delivered Time**""")
|
| 194 |
+
return
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
@app.cell
|
| 198 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 199 |
+
real_vs_estimated_delivery_time = query_results[
|
| 200 |
+
QueryEnum.REAL_VS_ESTIMATED_DELIVERED_TIME.value
|
| 201 |
+
]
|
| 202 |
+
real_vs_estimated_delivery_time
|
| 203 |
+
return
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
@app.cell
|
| 207 |
+
def _(mo):
|
| 208 |
+
mo.md(r"""**G. Global Amount of Order Status**""")
|
| 209 |
+
return
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
@app.cell
|
| 213 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 214 |
+
global_amount_order_status = query_results[
|
| 215 |
+
QueryEnum.GLOBAL_AMOUNT_ORDER_STATUS.value
|
| 216 |
+
]
|
| 217 |
+
global_amount_order_status
|
| 218 |
+
return
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
@app.cell
|
| 222 |
+
def _(mo):
|
| 223 |
+
mo.md(r"""**H. Orders per Day and Holidays in 2017**""")
|
| 224 |
+
return
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
@app.cell
|
| 228 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 229 |
+
orders_per_day_and_holidays = query_results[
|
| 230 |
+
QueryEnum.ORDERS_PER_DAY_AND_HOLIDAYS_2017.value
|
| 231 |
+
]
|
| 232 |
+
orders_per_day_and_holidays
|
| 233 |
+
return
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
@app.cell
|
| 237 |
+
def _(mo):
|
| 238 |
+
mo.md(r"""**I. Freight Value Weight Relationship**""")
|
| 239 |
+
return
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
@app.cell
|
| 243 |
+
def _(QueryEnum, query_results: "dict[str, DataFrame]"):
|
| 244 |
+
freight_value_weight_relationship = query_results[
|
| 245 |
+
QueryEnum.GET_FREIGHT_VALUE_WEIGHT_RELATIONSHIP.value
|
| 246 |
+
]
|
| 247 |
+
freight_value_weight_relationship
|
| 248 |
+
return
|
| 249 |
+
|
| 250 |
+
|
| 251 |
+
@app.cell
|
| 252 |
+
def _(mo):
|
| 253 |
+
mo.md(r"""## 3. Plots""")
|
| 254 |
+
return
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
@app.cell
|
| 258 |
+
def _(mo):
|
| 259 |
+
mo.md(r"""**A. Revenue by Month in 2017**""")
|
| 260 |
+
return
|
| 261 |
+
|
| 262 |
+
|
| 263 |
@app.cell
|
| 264 |
def _():
|
| 265 |
return
|