Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AddMonths in set analysis?

Hi,

Is it possible to use Addmonths in set analysis?

I want to rewrite this:

sum

({$ <BETBOKFD_IN = {">2008-06-30"}> }_ForsCounter)



With something like this:

sum

({$ <BETBOKFD_IN = {">=$(AddMonths(AVSERPERIOD,-15)"}> }_ForsCounter)



Is it possible and how do I write it (as the above code dosen't work)?

1 Solution

Accepted Solutions
Not applicable
Author

Hi Christina,

it´s working now. You missed brackets in your expression and please avoid spaces.

Have a nice weekend!

Rainer

View solution in original post

8 Replies
Not applicable
Author

Hi,

see the attached example.

God luck!

Rainer

Not applicable
Author

Thanks,

Now I can copy your syntax, I still doesn't work for me though. I'll have another try at it later.
I'll let you know.

Regards,
Christina

Not applicable
Author

Christina,

be aware of the date format. That´s number one of most of the problems by using "Set Analysis".

Rainer

Not applicable
Author

Hi again,

I've tried Rainer's soloution, but apparently I'm doing something wrong as his set analysis is working.
Therefore I attached my example.

All suggestions are welcome.

By the way my version is 8.5

Regards,

Christina

Anonymous
Not applicable
Author

Hi,

Try this.....

sum

({<BETBOKF_IN = {"<=$(=date(max(addmonths(AVSERPERIOD,-15))))>=$(=date(max(addmonths(AVSERPERIOD,0)))))"}>} _ForsCounter)

Cheers.

Ad.

Not applicable
Author

Hi,

Tnks Abu, but it still doesn't work, pls se the attached file with the code. It's a very stripped bit of code just to show the problem.
To add the date is always a good idea though.

Christina

Not applicable
Author

Hi Christina,

it´s working now. You missed brackets in your expression and please avoid spaces.

Have a nice weekend!

Rainer

Not applicable
Author

Thanks very much Rainer,

I really appreciate you taking the time to correct my misstakes.
I found set analysis very useful, but a bit hard to get right.

I also wish you a nice weekend.

Christina