Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
CarlosCan
Contributor
Contributor

Avg Positive Values in Simple Table

Hi Community good morning,

I have a simple table which shows negative and positive values.

How can I get the average of the positive values, excluding negative or zero values?

the expected value in the sum of the table should be 0.18 not 0.78, not 0.09.

My Expression is:

if(

(num(IF(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>}HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))< 0 ,-1, 1)*
((Div(fabs(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>} HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))),1))
+ (Frac(fabs(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>} HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))))* 0.6)),'0.00'))>0,

num(IF(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>}HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))< 0 ,-1, 1)*
((Div(fabs(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>} HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))),1))
+ (Frac(fabs(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"}>} HoraRegistroN-HoraFinEN),TIENDA,DÍA_MES))))* 0.6)),'0.00'),0)

Thanks for your support!!!

Regards.

Labels (3)
1 Reply
EdgarOlmos
Contributor III
Contributor III

Hi Carlos.

You can use a statement like this in your set analysis.

IF(Avg(Aggr(AVG({<Actividad={"CheckIn"},TipoCheck={"Llegada a tienda"},   Value = {">0"}   >}

 

Regards