Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
PuriVelasco
Creator
Creator

Set analysis with previous date

Hello,

I want to achieve number of occurrences for current and previous month in a table.

For previous month I am using:

Count({$<[Servicio.MesAno]={"$(=MonthName(addmonths([Servicio.MesAno],-1)))"}, Servicio.alturaModulo={"pies"}>} Servicio.codArticulo)

where Servicio.MesAno is like ene. 2019, feb. 2019, etc.

My sentence doesn't run. I need your help.

Thank you very much

Labels (2)
9 Replies
Anil_Babu_Samineni

Perhaps this?

Count({$<[Servicio.MesAno]={"$(=addmonths(Max([Servicio.MesAno]),-1))"}, Servicio.alturaModulo={"pies"}>} Servicio.codArticulo)

Or

Count({$<[Servicio.MesAno]={"$(=Date(addmonths(Max([Servicio.MesAno]),-1),'Date Format'))"}, Servicio.alturaModulo={"pies"}>} Servicio.codArticulo)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PuriVelasco
Creator
Creator
Author

Sorry Anyl but don't run.

Anil_Babu_Samineni

What it is returning?

MonthName(AddYears(Max(Servicio.MesAno),-1))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PuriVelasco
Creator
Creator
Author

may. 2018

Anil_Babu_Samineni

Better, If you could draft sample data for us, Try this way

Count({$<[Servicio.MesAno]={"$(=MonthName(addmonths(Max([Servicio.MesAno]),-2)))"}, Servicio.alturaModulo={"pies"}>} Servicio.codArticulo)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PuriVelasco
Creator
Creator
Author

I would have in a table the next fields.

Current month - Last month - Last year

And in each field their values of codArticulo.

I have the data from the data base but I don't know how I have to write to see them in the table. Now I only see the current month data.

Thank you for your efforts.

Anil_Babu_Samineni

Would you able to share sample and expected result?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PuriVelasco
Creator
Creator
Author

CapturaQS.PNG

In the 'Actual' field we can see the data for the current year and month. In the 'Mes pasado' field I would like see the data of last month.

Thank you.

 

PuriVelasco
Creator
Creator
Author

In row ene. 2019 field 'Mes pasado' I would have to see the data of dec. 2018; in row feb. 2019, the field 'Mes pasado' would show the data of ene. 2019, etc.