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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Variables in Fields when creating a Filter

I am new to Nprinting and wanted to know if it was possible to have a filter based on a variable?

For example, the document I use has a variable (vLastMonth), and I want to filter a field (Acctg Mon) to whatever the last month was so the report is created only showing the data from the past month. I tried using =vLastMonth and just vLastMonth in the value for the field filter.

When I brought them into the report and applied them to the image, I was getting an error on my charts that said it couldn't be calculated.

Am I missing some step somewhere in the process of applying a filter with a variable expression, or is this not the right way to go about this.

I read through the article below but couldn't find anything related to this specific problem.

How to Create Static and Dynamic Filters Based on Fields

Thanks in advance.

1 Solution

Accepted Solutions
vikasmahajan
MVP
MVP

try with =$(vLastMonth)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

View solution in original post

2 Replies
Stephen_Jasionowski
Employee
Employee

You can create filters in NPrinting using QlikView variables. It's in the ribbon in the same right next to Fields. See the following tutorial: Set a QlikView Variable to a Specific Value Using Filters

Or you can have a dynamic filter based on a QlikView expression. What is the logic behing vLastMonth? If it is something like month(now)-1, then you can use that syntax in the value column, and not use the variable at all. You would have to check "Evaluate" if using this method.

vikasmahajan
MVP
MVP

try with =$(vLastMonth)

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.