Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How force function AddMonths work?

Hi to all!

I have field with Date, and in SET ANALYSIS i need Date bigger at 1 month.

But AddMonths Does not work...

Look in attach.

1 Solution

Accepted Solutions
Not applicable
Author

use dis in set CurrDate ={'$(=AddMonths(CurrDate,1))'}

View solution in original post

9 Replies
Gysbert_Wassenaar

In a text box you can use =AddMonths(CurrDate,1) if you first select one value in the field CurrDate.


talk is cheap, supply exceeds demand
Not applicable
Author

Do not use Dollar expansion in text object, use it Like =Addmonths(CurrDate,1)

Not applicable
Author

yes, i know.

but i use AddMonths in SET ANALYSIS, and there $(=AddMonths(CurrDate,1)) does not work, because this function doesn't result a date.

and a textboxes i add for clarity.

Not applicable
Author

yes, look my answer above

Not applicable
Author

Привет!

CurrDate - это поле, Set Analysis не принимает поле, как правую часть условия, ему нужно конкретное значение. Попробуй использовать функцию p():

$(=AddMonths(p(CurrDate),1))

Gysbert_Wassenaar

Because your field CurrDate doesn't contain any value that's exactly a month later than another value. If you add such a value you can see that addmonths does work. See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

use dis in set CurrDate ={'$(=AddMonths(CurrDate,1))'}

Not applicable
Author

Он прекрасно принимает поля. когда в них выбрано одно значение. Если не выбрано ничего или выбрано несколько то конечно ничего работать не будет.

Not applicable
Author

Thank You, i just forgot to put quotes in textbox

If in TX08 put text "='$(=AddMonths(CurrDate,1))'" - all works perfectly!