Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

variable

I created two variable:

  1. Month1: it is current month
  2. Month2: it is descrive a specific month

Month1= Text(Month(max(PER_RIF)))& Text(Year(max(PER_RIF)))

Month2= Text(Month(max(PER_RIF-1)))& Text(Year(max(PER_RIF-1)))

Now, I want to do some sum.

I try to use:

=sum({<{per_rif=$(date(Month1))}>} [Incassato_Altro _nel _periodo])

But when I try to set the sum it fails.

I can’t selection nothing because I want to automatizaren all things.

What Am I doing wrong ?

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

I'm sorry, I forgot to erase some characters from your formula that were wrong... try:

=sum({$<PER_RIF={">=$(=MonthStart(Max(PER_RIF)))<=$(=MonthEnd(Max(PER_RIF)))"}>} [Incassato_Altro _nel _periodo])

View solution in original post

8 Replies
Not applicable
Author

I think your set analysis is incorrect, but also I suspect your variables are wrong.

According yo your variables, you get the month and the year from the same field: PER_RIF. Does PER_RIF has date values? If it's so... then you could do something like this:

=sum({<{PER_RIF={">=$(=MonthStart(Max(PER_RIF)))<=$(=MonthEnd(Max(PER_RIF)))"}>} [Incassato_Altro _nel _periodo])


That would give you the sum of [Incassato_Altro _nel _periodo] values for the max MonthYear selected or available (the 30 or 31 days included in the Month).

I think this example from Steve Dark may hel you a lot to learn about playing with Dates in Set Analysis.

http://community.qlik.com/docs/DOC-4313

Regards!

Not applicable
Author

Hi Carlos,

thanks for the reply. But if I use your script in my object the result is: "-".

The PER_RIF field has a date value. I read your suggestion article by Steve Dark but i don't understand where i need to use that script in my own one. Follow a screenshot that i hope will help you to better understant my issue.

Thanks in advance.

screenshot.jpg

swuehl
MVP
MVP

Check your curly brackets (i.e. { and } )

I believe you have put one opening curly bracket too much into your expression directly before the field name PER_RIF. Remove this one.

Not applicable
Author

I'm sorry, I forgot to erase some characters from your formula that were wrong... try:

=sum({$<PER_RIF={">=$(=MonthStart(Max(PER_RIF)))<=$(=MonthEnd(Max(PER_RIF)))"}>} [Incassato_Altro _nel _periodo])

Not applicable
Author

thanks thanks!!!!!!!!

it's right!!!!!!!

thanks you

Not applicable
Author

it's right!!!!!!!

thanks you!

Regards!

Not applicable
Author

Hi, sorry, I have the same problems but for precedetent month.

How can i do this?

My date are simililar of ciroscar's date.

Thanks in advance.

Not applicable
Author

sorry, I'm finding solution in article by Steve Dark.

thanks a lot