Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I´m trying to sum 2 counts like this, but i get no result
SUM(Count(if(category='x', item))+ (Count(if(category='y', item))
Hi Polschou,
why you use sum?
you can get the result direct with
Count(if(category='x' or category='y', item))
and try to use set anylasis as following
count({<category={'x','y'}>} item)
hope this help you
Hi,
you have to use the AGGR function, if you use two aggregation functions like this:
Sum(Aggr(Count(if(category='x', item)),Dimension))+ Sum(Aggr(Count(if(category='y', item)),Dimension))
or
Sum(Aggr(Count(if(category='x' or category='y', item)),Dimension
with more performance I would recommend this:
Sum(Aggr(Sum(if(category='x' or category='y', 1,0)),Dimension))
Dimension can be more than one: Dim1,Dim2,Dim3,...
Hi Polschou,
why you use sum?
you can get the result direct with
Count(if(category='x' or category='y', item))
and try to use set anylasis as following
count({<category={'x','y'}>} item)
hope this help you
Hi Martina
I tried somthing else and it seems to work for me - I use this to add the 2 conditions
COUNT(IF(categori='x' OR categori='y',item))
Hi Mohammed
If I want to add another condition like this
COUNT(IF(categori='x' OR categori='y' AND YEAR='2011',item)) - but this gives a wrong result - I cant attach a
QW file
Hi polschou
i think it should be like the following:
COUNT(IF((categori='x' OR categori='y' ) AND YEAR='2011',item))
count({<categori={'x','y'},YEAR='2011'>} item)
the diffrent is ( ) between Category and Year
hope this help you.