Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
javier_florian
Creator III
Creator III

Table - Total Count differences

Hi Everyone,

I have an expression to count IDs with three conditionals:

Table:

Cod prodCount Total
14428
24501
3244
40
51
60
71119
83380
Total17053

=if(Flag_A <> 'No',

    (Count(distinct(ID))),

    if (Productos.CodProducto = '150' ,

    (Count(distinct(ID)))/3,

    if (Flag_B = 'Si' ,

        (Count(distinct(ID)))/2,

             (Count(distinct(ID))))))

However, general total is 13.673, different to 17.053... Trying to resolve this issue, I found that Product 8 has Flag_B = 'Si' and the expression must take Count(ID)/2... The Count Total to Product ID 8 is fine (3.380) but the general total takes Count(ID), 6.670.

How I can fix this formula?

Regards,

-JFlorian

2 Replies
srchilukoori
Specialist
Specialist

Switch it to Sum of Rows, rather than expression totals on the Expression tab of the Chart properties.

javier_florian
Creator III
Creator III
Author

Hi All,

I have a workaround..

=(Count({<Flag_B={"Si"}, Año={$(vMaxAño)}>} Distinct ID)/2)

+(Count({<Flag_B={"No"}, Año={$(vMaxAño)}>} Distinct ID))

-JFlorian