Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a problem with this expression.
I´m getting the date wich there was the max value of one process, this is working fine but there is this limitation:
this date must be between the week selected and 12 moths before, so SemanaEjercicioMax={'<=$(=CIM.SemanaEjercicio)'}, is to control that date is before the week selected and it´s working, the problem is that Fecha_Maximo={'>=$(=AddMonths(min([CIM.%Fecha]),-11))'}, doesn´t work, is like the blue condition void the red condition...
aggr
(
FirstSortedValue
(
{<CIM.PERIODO=,CIM.Mes=,CIM.AñoDomingo=,
Fecha_Maximo={'>=$(=AddMonths(min([CIM.%Fecha]),-11))'}, // 12 months before, I do min(CIM.%Fecha) because the selection must be a week.
SemanaEjercicioMax={'<=$(=CIM.SemanaEjercicio)'}, // week <= week selected
CIM.Semana=,CIM.SemanaEjercicio=,Fecha_Maximo=, SemanaMax_CIM=, SemanaCIM=>}
Fecha_Maximo, -Cantidad_mkgl_Maxima
)
,Supervisor_Maximo,Proceso_PSCIM_Maximo
)
Thank you, regards.
Chema
Solution:
aggr
(
FirstSortedValue
(
{<CIM.PERIODO=,CIM.Mes=,CIM.AñoDomingo=,
Fecha_Maximo={'>=$(=AddMonths(min([CIM.%Fecha]),-11)) <=max([CIM.%Fecha])'}
CIM.Semana=,CIM.SemanaEjercicio=,Fecha_Maximo=, SemanaMax_CIM=, SemanaCIM=>}
Fecha_Maximo, -Cantidad_mkgl_Maxima
)
,Supervisor_Maximo,Proceso_PSCIM_Maximo
)
Solution:
aggr
(
FirstSortedValue
(
{<CIM.PERIODO=,CIM.Mes=,CIM.AñoDomingo=,
Fecha_Maximo={'>=$(=AddMonths(min([CIM.%Fecha]),-11)) <=max([CIM.%Fecha])'}
CIM.Semana=,CIM.SemanaEjercicio=,Fecha_Maximo=, SemanaMax_CIM=, SemanaCIM=>}
Fecha_Maximo, -Cantidad_mkgl_Maxima
)
,Supervisor_Maximo,Proceso_PSCIM_Maximo
)