Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
carolinne88
Creator
Creator

Month before the selected one

Hello guys. I need help again.


I have the down table with the date fields and last month's variable (vMesRef).


vMesRef => PerID = {$(=Max(PerID))}


I need a variable that brings me the "MêsAno" before the selected one. I tried the variable "vMesRefAnt", but it does not work.


vMesRefAnt => PerID = {$(=Max(PerID)-1)}


Can someone help me?


tabela data.jpg


erro variável.jpg

1 Solution

Accepted Solutions
carolinne88
Creator
Creator
Author

Hello guys!

After some time and countless attempts, I discovered together with a colleague something that may have prevented the expression from working.

In the variable description field I had commented another expression and when I deleted the comment, it worked!

I believe that is the explanation, but there are some mysteries of qlik that I never discover.


Thank you all!

View solution in original post

20 Replies
sunny_talwar

This is just saying that the syntax editor doesn't understand your expression, but if this works or not can be checked by clicking okay to see if the result is what you expected to see. The reason for the error is use of the variable. Since, expression editor doesn't know what the variable is going to be evaluated to, it throws an error. It happens a lot of the time and most of the time, I don't even pay attention to this error unless I am not seeing the result I am expected to see

carolinne88
Creator
Creator
Author

Hello, Sunny!

In the object it does not recognize the expression. I do not understand why.
The first object (with the number 52) is the expression "= Count ({<$ (vMesRef)>} Natureza_Jurídica").

The second object is the expression "= Count ({<$ (vMesRefAnt)>} Natureza_Jurídica").


erro objeto.jpg

pradosh_thakur
Master II
Master II

Try changing this in the variable

vMesRef => PerID = {"$(=Max(PerID))"}

vMesRefAnt => PerID = {"$(=Max(PerID)-1)"}


regards

Pradosh

Learning never stops.
carolinne88
Creator
Creator
Author

Hi, Pradosh!


I tried, but it's still the same. =/

lorenzoconforti
Specialist II
Specialist II

Try single quotes

vMesRef => PerID = {'$(=Max(PerID))'}

vMesRefAnt => PerID = {'$(=Max(PerID)-1)'}

carolinne88
Creator
Creator
Author

Nothing.. =(

sunny_talwar

Can you try this

=Count({<$(=vMesRefAnt)>} Natureza_Jurídica)

MK9885
Master II
Master II

Maybe this?

vMesRef => PerID = {"=$(Max(PerID)"}

vMesRefAnt => PerID = {"=$(Max(PerID)-1)}

lorenzoconforti
Specialist II
Specialist II

can you post your application?