Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ratier
Contributor III
Contributor III

Chart Level Script Help: Adding Cummulative Values to a Bar Chart

I have a bar chart with montly values that I need to add, in the end of it, the cumulative sum of the entire year. This must be filter sensitive so I can see the entire database or just the years I filter. Since my Dimension is labeled "Mensal" and my Measure is labeled "Orçado", I used this chart level script:

Let vTotal = 0;
Let P = HCNoRows();
For J = 1 to P
Let vTotal = vTotal + HCValue(Orçado,J);
Next
Add Load 'Total' as "Mensal", $(vTotal) as Orçado Autogenerate 1;

The following error occur:

"Load statement could not find target column [1268] in hypercube"

If I change to "$(vTotal)" to "Floor($(vTotal))", the error disappears but the bar chart creates a empty bar.

Ratier_0-1692883692826.png

What am I doing wrong? Here's some background info that might help:

Database:
  • Excel Workbook named "Base de Dados Qlik.xlsx" with 3 Sheets: "NAVIO", "MENSAL" and "ANUAL";
  • Data needed is inside "MENSAL" sheet. Not all the 55 columns in this sheet are needed at the moment;
  • Some cells are formulas (i don't know if it would interfer with Qlik Sense);
  • Data is transfered to Qlik Sense via OneDrive connection;
  • I'm using QlikSense Cloud;
Data Load Editor:

[MENSAL]:
LOAD
          "Ano2", //Contains the year of the data. More specifically 2023 and 2024;
         "Mês2"//Contains the month of the data in number. For exemple, January would be 1. Contains all months of 2023 and only Jan2024 (13 Rows);
         "Mês.Ext"//Contains the month of the data by name. This is the Dimension I used in the bar chart;
         "Qua.2"//Contains the quarter of the data, beeing "T1", "T2", "T3" and "T4" ("T" is the equivalent of "Q" in Portuguese);
         "Sem.2"//Contains the quarter of the data, beeing "S1" and "S2";
         "Orçado TOTAL (USD)" //Data used as Measure. The "Orçado" Measure is the formula "Sum([Orçado TOTAL (USD)])".
FROM [lib://Drive Pessoal Rafael Ratier/13 - GPCP Qlik/Base de Dados Qlik.xlsx]
(ooxml, embedded labels, table is MENSAL);

Labels (4)
1 Reply