Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian
Contributor
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
Master II

Can you show screenshots please

Learning never stops.
lorenzoconforti
Specialist II
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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
cristian
Contributor
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
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
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?