Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Can anybody help me?
I need to create a table to compare the current year (or selected) versus the prior year, I'm using the variable: Año={$(=Max(Año)-1)}, it works in other reporte that I have, but it doesn't in this one, I'm wondering if it isn't working due to in this case I'm using an aggregated function.
For the current year (in the case of Light vehicles or "Ligeros"), I'm using the following expression:
=Sum(AGGR(COUNT({<AGRUPACION_LP={'Ligeros'}>}ID_TRANSIT)*POND_TOTAL, FECHAT, PROYECTO, DESCRIPCION))/COUNT({<DUE={'1'}>}Día)
And, for the prior year I'm using the following:
=Sum(AGGR(COUNT({<Año={$(=Max(Año)-1)},AGRUPACION_LP={'Ligeros'}>}ID_TRANSIT)*POND_TOTAL, FECHAT, PROYECTO, DESCRIPCION))/COUNT({<DUE={'1'}>}Día)
This is the table:
Thanks in advance
May be try this
=Sum({<Año = {$(=Max(Año)-1)}>} Aggr(Count({<Año = {$(=Max(Año)-1)}, AGRUPACION_LP = {'Ligeros'}>} ID_TRANSIT) * Only({<Año = {$(=Max(Año)-1)}>} POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/COUNT({<DUE = {'1'}, Año = {$(=Max(Año)-1)}>} Día)
May be try this
=Sum({<Año = {$(=Max(Año)-1)}>} Aggr(Count({<Año = {$(=Max(Año)-1)}, AGRUPACION_LP = {'Ligeros'}>} ID_TRANSIT) * Only({<Año = {$(=Max(Año)-1)}>} POND_TOTAL), FECHAT, PROYECTO, DESCRIPCION))/COUNT({<DUE = {'1'}, Año = {$(=Max(Año)-1)}>} Día)
Great!
Thanks
Awesome, glad it worked.