Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
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 (5)
0 Replies