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: 
Jozefswistak
Contributor
Contributor

Error in set ad hoc element list, when use code-implemented filters

Hello.
After using "Set current expressions" to apply a filter in a code of a Measure, I'm trying to set this filter to my own defined value. Here is a code:

sum({<ProductionDate={year(Today()-365}>}[ProductionQuantity])

I'm trying to do this, because I want to have both today and one year ago to aply these values in the same report in NPrinting.

But i return an ifo, that Error in set ad hoc element list.

The question is: is it possible to do like I want (set filter to one year back via code)? Or is it not possible?

Labels (2)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

 

sum({$<ProductionDate={"$(=AddMonths(Today(),-12))"}>} [ProductionQuantity])

sum({$<ProductionDate={"$(=AddYears(Today(),-1))"}>} [ProductionQuantity])

 

you can find a handbook on set analysis here

https://community.qlik.com/t5/QlikView-Documents/Set-Analysis-syntaxes-examples/ta-p/1491810

 

View solution in original post

1 Reply
maxgro
MVP
MVP

 

sum({$<ProductionDate={"$(=AddMonths(Today(),-12))"}>} [ProductionQuantity])

sum({$<ProductionDate={"$(=AddYears(Today(),-1))"}>} [ProductionQuantity])

 

you can find a handbook on set analysis here

https://community.qlik.com/t5/QlikView-Documents/Set-Analysis-syntaxes-examples/ta-p/1491810