Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 3 fields-A,B & C
A is the primary key.
I wrote the expression, count(if(B<>C,A)).
I also tried this: sum(if(B<>C,1,0)).
But , I am getting wrong values with both expressions.
Kindly give your suggestions.
-Anju
Hi,
Try like this
=sum(Aggr(if(B<>C,1,0), A))
But it is better to get the same in script.
LOAD
*,
if(B<>C,1,0) AS Flag
FROM DataSource;
Now just use Sum(Flag).
Aggr and if() may lead to performance issues.
Regards,
Jagan.
I forgot to add a condition.That was why I was getting the wrong answer.
Sorry!!