Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rafaeloneil
Contributor III
Contributor III

Expression to count the last 120 days with makedate and other criteria

Hello Guys, I have the table below (Attached)

      

Cod_AgenteNomeAgUfDiaMêsAnoNuChassi
120ARS1122018KDJDKCJDOLDJ12486
123BRS2102018KDJDKCJDOLDJ12489
125CRS382018KDJDKCJDOLDJ12492
169DRS462018KDJDKCJDOLDJ12495
171,5ERS542018KDJDKCJDOLDJ12498
186,4FRS622017KDJDKCJDOLDJ12501
201,3GRS792017KDJDKCJDOLDJ12504
216,2HRS872017KDJDKCJDOLDJ12507


and I need to only count values ​​greater than or equal to 120 days ago,

the problem is that I do not have a date field already created in the table,

I have to use the makedate function to create this field, but it is not working and I also


do not have access to create variables and / or create the field at the time of the script execution


(this is a read-only qvd file on the server)


Follows my failed expression:


COUNT({$<Uf={'RS'}, Date(Num(MakeDate (Ano, Mes, Dia)))>= Date(Num(Today()))-120)>}[NuChassi])

      

can you help me?


2 Replies
Anil_Babu_Samineni

I haven't see your date field in your table, perhaps this?

COUNT({$<Uf={'RS'} >} If(Date(Num(MakeDate (Ano, Mes, Dia)))>= Date(Num(Today()))-120)),[NuChassi])

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
rafaeloneil
Contributor III
Contributor III
Author

Really did not work the suggested expression, I inserted the table but I do not know why it is not visible in the post, it continues in the image format

Tabela5.png