Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
alvin_chien
Contributor
Contributor

NPrinting filter greater then, less then, not equal to

Hi All,

Can anyone show me how to use the Evaluate value to do the condition like <> 0, >100, < 100 etc?

Assume have a field named "Amount" in my report, and I want to filter accordingly.  thanks!

12 Replies
lcontezini
Partner - Creator
Partner - Creator

You can do it inside your application using set analysis.

sum({<Amount -= {'0'}>}Amount)


sum({<Amount = {'>100'}>}Amount)


sum({<Amount = {'<100'}>}Amount)

Chanty4u
MVP
MVP

you can create a  flag in qlik and use that in nprinting  0,1

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

as usual i suggest you go first to help document, where in point 5 you have example.. Please keep in mind that evaluated formula needs to return single value.

If you want your formula to filter range of values you need to use alternatives mentioned above by other community users.

https://help.qlik.com/en-US/nprinting/February2018/Content/ReportsDevelopment/Static-dynamic-filters...

Creating a dynamic filter with formulas

You can use QlikView and Qlik Senseformulas to calculate values to be used in filters. Each formula must return a single value and use QlikView or Qlik Sense syntax. For example, you can use a formula to calculate the value of the previous year and compare it with the Year field in a filter.

Do the following:

  1. Create a new Filter based on the Sales Demo app, and name it Previous year.
  2. Add the field Year from the Sales Demo connection.
  3. Scroll down to the Values area.
  4. Select Evaluate value from the drop-down list.This option forces Qlik NPrinting to send the formula that you insert in the dialog box to QlikView or Qlik Sense, which will evaluate the result and return it to be used in the filter.
  5. Enter a formula in the Value box. For example, to retrieve the value of the last year, enter =Year(now())-1.You can click Add value to add another formula. Adding many values for the same field creates a logical "or" association. The filter will keep data that matches one or both values.
  6. Click Create.

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

you must regenerate the cache in order to see the object in the template editor.

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Daniel_Jenkins
Specialist III
Specialist III

Did you hear about search strings and single quotes?

....Then, wildcards in strings enclosed by single quotes will no longer be considered as wildcards. Instead, the strings will be interpreted as literals, i.e. the engine will try to match the string with a field value containing the ‘*’ character. The same logic will apply also to relational operators and equals signs.

Quotes in Set Analysis

HTH - Daniel.

alvin_chien
Contributor
Contributor
Author

Hi Lech,

Thanks for the information.  I checked this before, I cannot get it, so I post here.

I try to put value field as below.  It all filter out all data.  So I would like to check what is the correct syntax to put on the value.

="> 0"

=Amount > 0

>0

alvin_chien
Contributor
Contributor
Author

Thanks Chanty,

That's how I current workaround, but this is kind of workaround is not good, as I need to create extra fields in the App that really don't need.

alvin_chien
Contributor
Contributor
Author

Thanks Leonardo,

I know how it works on Qlik Sense, but I only want this filter on NP when I generated the report.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

so the result of any formula needs to be single value. Therefore your filter like > 0 etc will not work as it may return multiple values..

Those technics need to be implemented on model side.

regards

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Ruggero_Piccoli
Support
Support

Other alternatives are:

- create a calculated column in the chart used for reporting with the comparison formula write in order to get True or False (dingle value, you can also use 1 or 0 etc). If you want you can hide the column.

- create a calculated field in the reload script with the comparison formula. Compared with previous solution this is faster when creating reports but more rigid.

Best Regards,

Ruggero

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.