Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Buenas,
Tengo problemas con una expresión ya que tengo que multiplicar registros y no sumatorios pero no sé como hacerlo, me explico:
En la columna resaltada en rojo tengo esta expresión:
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
Básicamente estoy multiplicando la columna (personas) por la columna HORAS PLANIFICADAS menos la columna averías y preventivo. La cuestión es que el calculo por días lo hace bien pero el sumatorio no, ya que no es lo mismo multiplicar el total de cada columna que sumar las multiplicaciones de cada dia.
Gracias de antemano.
Un saludo.
Hi
unfortunately , difficcult for me to help you further more as data model and mesure seems complex
want may be about replace sum by avg like this
AVG(Aggr(Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}M2_CONPEPTO),Fecha_Comun))
/AVG( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun))
or this
avg(aggr(
Sum(Aggr(Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}M2_CONPEPTO),Fecha_Comun))
/Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun))
, Fecha_Comun))
Hi
May be this
Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Dia ))
Thank you so much, I think that is the solution but the problem is that I need to divide the column (PROD(M2)_A.) between the expression that I posted before.
Column "PROD(M2)_A."= Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS)
I tried to modify your expression but it's not working:
Sum( Aggr(
Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS)/
(((Sum({<[Máquina]={'Anodizado'}>}Personas))+(Sum({<[Máquina]={'Anodizado'}>}[Personas preproceso])))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo]))))
,Dia ))
Thank you in advance.
hi
may be it is because this mesure "PROD(M2)_A." is giving 0 for each day (DIA) but gives 31.413 for null dia
then 0 divided by something will always giving 0
your first expression was :
personas * HORAS PLANIFICADAS - averías - preventivo
now you want this
PROD(M2)_A / (personas * HORAS PLANIFICADAS - averías - preventivo)
So try this :
1 : trying to aggr PROD M2 by Day
Sum( Aggr(
Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS) , DIA))
/
Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Dia ))
2 : trying to avoid dia dimansion in the set analysis mesure for
Sum({<[Dia]= ,[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS)
/
Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Dia ))
3 trying with column function :
column(3) / (column(4) -column(5) -column(6) )
pretty not sure
Hi! Thank you so much for your help. Actually, I'm not using this table for my analysis I just used this trying to find the problem eith the expression. I have this graphic:
This is the dimension:
For the expression, I tried yours but doens't work exactly.
In this case I'm mixing datan from 3 different tables:
PROD(M2)_A [TABLE "Datos_Producción"]/ (personas [TABLE "Partes"] * HORAS PLANIFICADAS [TABLE "Partes"]- averías [TABLE "Paradas"]- preventivo[TABLE "Paradas"])
Note: PROD(M2)_A = Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA],[Elemento asociado],[CODIGO_MAQUINA]=,[FASE]=,[Motivo]=>}M2_CONPEPTO)
With this expression I get data more accurate but not exact:
Sum( Aggr(
Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS) ,Fecha_Comun))/
Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun ))
In January I get 8, but the correct amount is 13:
This is the correct calculation for 10/01/2022:
PROD(M2)_A [TABLE "Datos_Producción"]/ (personas [TABLE "Partes"] * HORAS PLANIFICADAS [TABLE "Partes"]- averías [TABLE "Paradas"]- preventivo[TABLE "Paradas"])
Productividad= 1.127/(10*(16-8))= 14
but I get 12:
Thank you in advance.
Thank you so much for your help! Actually I'm not using the table for my analysis I just used this trying to find out the problem with the expression.
I have this graphic for the productivity = PROD(M2)_A / (personas * HORAS PLANIFICADAS - averías - preventivo)
Note: PROD(M2)_A = Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA],[Elemento asociado],[CODIGO_MAQUINA]=,[FASE]=,[Motivo]=>}M2_CONPEPTO)
Right now I have this dimension:
and this measure:
Sum( Aggr(
Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}BARRAS_ACEPTADAS) ,Fecha_Comun))/
Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas)+Sum({<[Máquina]={'Anodizado'}>}[Personas preproceso]))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun ))
Here I have data from 3 different tables:
I modified the expression you posted and it's more accurate but not correct. For January I get 8:
But it's 13:
For example, for 10/01/2022 I get 12:
But the correct calculation is:
Productividad= 1.127 [Producción]/(10[Personas]*(16[Horas planificadas]-8[Preventivo]-0[Averias]))= 14
Thank you in advance!
It finally worked with this:
Sum(Aggr(Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}M2_CONPEPTO),Fecha_Comun))
/Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun))
Now, I just have differences in one month (February):
In the file the month is calculated with the average of the days (23,26) and in Qliksense makes the division between the sum of the produccion and the hours (39.736/2.511.83)= 15.82.
Hi
unfortunately , difficcult for me to help you further more as data model and mesure seems complex
want may be about replace sum by avg like this
AVG(Aggr(Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}M2_CONPEPTO),Fecha_Comun))
/AVG( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun))
or this
avg(aggr(
Sum(Aggr(Sum({<[FASE_REALIZADA]={'440'},[COD_MAQUINA]={'AN001'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}M2_CONPEPTO),Fecha_Comun))
/Sum( Aggr(
(Sum({<[Máquina]={'Anodizado'}>}Personas))*(((Sum({<[Máquina]={'Anodizado'}>}[Horas teoricas])))-(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas por avería]))-
(Sum({<[Máquina]={'Anodizado'},[Tipo parada]=,[DESC_MAQUINA]=,[Elemento asociado]=,[CODIGO_MAQUINA]=,[FASE]=>}[Paradas programadas/preventivo])))
,Fecha_Comun))
, Fecha_Comun))
Thank you so much! You have been very helpful, I really appreciate it.