Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
jyanik
Partner - Contributor II
Partner - Contributor II

Bar Chart Total Automatic to SUM

Have you seen that in a table chart, the default  Total Function of a measure  is 'Automatic' and you can change it to another function? Like Sum, Count, Avg, etc.

I have a bar chart that shows the total bar, calculated with the 'Automatic' function (I know because I have a table chart with the same expression that shows the same number in automatic), and I need it to show the total in SUM function, which is not an option for the bar chart. Does anyone know a way to do this? 

IF(
    ISNULL(GETFIELDSELECTIONS(Fecha)) AND
        ISNULL(GETFIELDSELECTIONS("Mes Año")) AND
        ISNULL(GETFIELDSELECTIONS(Mes)) AND 
        ISNULL(GETFIELDSELECTIONS(Año)),
        IF(
        Sum({<"Mes Año" = {'$(=v_MaximoMesCerrado)'},Tiempo={"*"}>}[Tiempo]) - SUM({<"Mes Año" = {'$(=v_MaximoMesCerrado)'},"Tiempo Teorico"={"*"}>}"Tiempo Teorico") > 0 ,
       Sum({<"Mes Año" = {'$(=v_MaximoMesCerrado)'},Tiempo={"*"}>}[Tiempo]) - SUM({<"Mes Año" = {'$(=v_MaximoMesCerrado)'},"Tiempo Teorico"={"*"}>}"Tiempo Teorico") , 0),
        IF(
        Sum({<Tiempo={"*"}>}[Tiempo]) - SUM({<"Tiempo Teorico"={"*"}>}"Tiempo Teorico") > 0
        , 
        Sum({<Tiempo={"*"}>}[Tiempo])- Sum({<"Tiempo Teorico"={"*"}>}"Tiempo Teorico"), 0)
    )
Labels (1)
  • SaaS

2 Replies
Digvijay_Singh

You may want to try by embedding your expression like below but not sure as I don't know much about your data model  - 

Sum(Aggr(<Your expression>,<Chart dimension>))

jyanik
Partner - Contributor II
Partner - Contributor II
Author

Hello! Thank you for you reply! I tried your suggestion but I encounter the following issue:

Putting only the expression by [Name] Gives me the Automatic Total Function, but embedding it as you described gives a a 0 in the chart.