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

set analysis month(addmonths(today(),-x))

Hello

Why this expresion is working 

sum({<luna={"$(=(month((today()))))"},an={"$(=year(addmonths(today(),-3)))"},lit_doc={'B'}>}cant)

but this does not 

sum({<luna={"$(=(month(addmonths(today(),-3))))"},an={"$(=year(addmonths(today(),-3)))"},lit_doc={'B'}>}cant)

6 Replies
pradosh_thakur
Master II

Can you show screenshots please

Learning never stops.
lorenzoconforti
Specialist II

Maybe you need to remove the addmonths from the first expression? Maybe you don't have data for that specific month/year combination. It would be easier to help you if you could provide more info

 

=sum({<luna={"$(=(month((today()))))"},an={"$(=year((today())))"},lit_doc={'B'}>}cant)

but this does not

sum({<luna={"$(=(month(addmonths(today(),-3))))"},an={"$(=year(addmonths(today(),-3)))"},lit_doc={'B'}>}cant)

Anil_Babu_Samineni

What luna field holding? Is that a Month, If so what format it is?

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
cristian
Contributor
Author

i try in wo different way
originally luna was a substring and it looks something like '07' for june and '11' for november, i saw that for the year there is no problem and the expresion is working
i try also to make a numeric luna field, like this, round(val(substr(nr_ies,9,2)),0) as lunan, but this does not work either. I assume that is a data compatibilitlity problem, but i don;t know where to look.
cristian
Contributor
Author

i have data, in it, and if i truy whithout addmonth it works, the problem is with addmonths, or maybe the data type 

cristian
Contributor
Author

hello

i think the problem is that my variable luna is in form of nn.00   i mean something like 11.00, and the month(addmonths(date())) return only nn, meaning  11 and it think tha 11 is different from 11.00.

is there a wat to make him understand that 11 is equal to 11.00?