adição de coluna pendente
This commit is contained in:
parent
446f023425
commit
1e7bac3054
@ -48,6 +48,7 @@ SELECT
|
||||
CASE WHEN promotions_description IS NULL THEN 'REGULAR' ELSE 'PROMOÇÃO' END AS tipo_promocao,
|
||||
COALESCE(stock_actual, 0) AS estoque,
|
||||
stock_intransit AS transito,
|
||||
pendingorder AS pendente,
|
||||
nextcycleprojection AS pv_mar,
|
||||
currentcyclesales AS venda_atual,
|
||||
CASE WHEN criticalitem_iscritical = 0 THEN 'REGULAR' ELSE 'CRITICO' END AS status_item
|
||||
@ -126,6 +127,7 @@ colunas_ordenadas = [
|
||||
'tipo_promocao',
|
||||
'estoque',
|
||||
'transito',
|
||||
'pendente',
|
||||
'pv_mar',
|
||||
'venda_atual',
|
||||
'status_item',
|
||||
@ -148,7 +150,7 @@ df3 = df3.groupby(['uf', 'canal','pdv'])['quantidade_ruptura'].sum().sort_values
|
||||
with pd.ExcelWriter(excel_path, engine='openpyxl') as writer:
|
||||
df2.to_excel(writer, sheet_name='Detalhado', index=False)
|
||||
df3.to_excel(writer, sheet_name='Resumo', index=False)
|
||||
|
||||
print(excel_path)
|
||||
ruptura_total = df2['quantidade_ruptura'].sum()
|
||||
ruptura_por_uf_pct = (
|
||||
df2.groupby('uf')['quantidade_ruptura'].sum()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user