Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
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
Highlighted
Not applicable

Re: variable

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
Highlighted
Not applicable

Re: variable

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!

Highlighted
Not applicable

Re: variable

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

Highlighted
MVP
MVP

Re: variable

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.

Highlighted
Not applicable

Re: variable

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

Highlighted
Not applicable

Re: variable

thanks thanks!!!!!!!!

it's right!!!!!!!

thanks you

Highlighted
Not applicable

Re: variable

it's right!!!!!!!

thanks you!

Regards!

Highlighted
Not applicable

Re: variable

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.

Highlighted
Not applicable

Re: variable

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

thanks a lot