Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have an expression to count IDs with three conditionals:
Table:
Cod prod | Count Total |
1 | 4428 |
2 | 4501 |
3 | 244 |
4 | 0 |
5 | 1 |
6 | 0 |
7 | 1119 |
8 | 3380 |
Total | 17053 |
=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
Switch it to Sum of Rows, rather than expression totals on the Expression tab of the Chart properties.
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