From 5b74133ecd960065ab748b0acc4739ae028bca05 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Jul 2026 11:14:58 +0000 Subject: [PATCH] =?UTF-8?q?diag(qlik):=20log=20=C3=A9chantillon=20qteByMon?= =?UTF-8?q?th=20(v=C3=A9rifie=20si=20les=20mois=20varient)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/qlik-playwright.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/qlik-playwright.ts b/src/lib/qlik-playwright.ts index 5d9db1e..805352f 100644 --- a/src/lib/qlik-playwright.ts +++ b/src/lib/qlik-playwright.ts @@ -600,6 +600,16 @@ export async function fetchNetworkMetricsPlaywright( const mm = monthly[code]; if (mm && Object.keys(mm).length) metric.qteByMonth = mm; } + // Diagnostic : échantillon du détail mensuel pour vérifier que les mois VARIENT + // (si toutes les valeurs sont identiques → la mesure Qlik ignore la sélection Date). + const sampleM = [...out.values()].find((m) => m.qteByMonth && Object.keys(m.qteByMonth).length > 1); + if (sampleM) { + const vals = Object.values(sampleM.qteByMonth ?? {}); + const allEqual = vals.every((v) => v === vals[0]); + console.log(`[qlik-pw] qteByMonth échantillon ${sampleM.codeCentrale} (total qté=${Math.round(sampleM.qteReseau)}, mois identiques=${allEqual}):`, JSON.stringify(sampleM.qteByMonth)); + } else { + console.log(`[qlik-pw] qteByMonth: aucun échantillon multi-mois (monthly vide ?)`); + } console.log(`[qlik-pw] ${out.size} produits réseau (cube ${result.size})`); // Échantillon brut pour vérifier que les 4 nouvelles mesures (cols 4-7) renvoient des valeurs const sample = (result.rows ?? []).slice(0, 3).map((r) => ({