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

Variable syntax

I have the following variable definition, but qlikview does not seem to like the syntax (the red squiggly underline starts with the first bracket).  'PeriodID' is previously defined, so I am not sure what qlikview does not like about this. The variable name is vSetYTD and the definition follows:

PeriodID = {"<=$(=Max(PeriodID))"},

Year = {
$(=Max(Year))},

  Quarter = ,

  Month = ,

   Period =  

5 Replies
swuehl
MVP
MVP

Might be just a problem with the syntax checker, since your definition is not a valid expression (and as far as understood, it's not supposed to be one, it's just the short cut for some set expression content snippet, right? So you want to use something like

=sum({<$(vSetYTD), Type = {'A'}>} Value)

)

santharubban
Creator III
Creator III

Try this

=sum({<PeriodID ={$(vSetYTD)}>} Value)

Not applicable
Author

It is setting vSetYTD (Year To Date) as a Set for Set Analysis against the same period for the previous year (which will be defined as vSetLYYTD (Last Year Year to Date).  The data to be compared can be changed.  This variable is just to set the base period for comparison.

swuehl
MVP
MVP

Understood, my point is that the syntax checker often claims something as 'wrong' which in fact is not (seen in full context).

Not applicable
Author

Ok.  Thanks.  Here's hoping it works!  LOL!