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: 
talita_verdes
Partner - Contributor III
Partner - Contributor III

Re-evaluate filters in NPrinting

Good Evening!


I have a Power Point report in NPrinting where I have the following settings:


1. Select the maximum of the year and month loaded in the Qlikview of each State.
2. Generate reports by Country and State.


Imagine that I have the following table:


Country

State

Max Date (DD/MM/YYYY)

Brazil

Minas Gerais

01/01/2017

Brazil

São Paulo

01/04/2017

Brazil

Rio de Janeiro

01/06/2017

In NPrinting I made a dynamic filter for the date, and I inserted the State field into the Cycle.


My problem is:
The report it generates is only from Rio de Janeiro - Brazil. I need NPrinting to re-evaluate the date for all States.


How can I do this?


Thanks

1 Solution

Accepted Solutions
talita_verdes
Partner - Contributor III
Partner - Contributor III
Author

Good Afternon!


I found the solution.


I created a trigger in the State field that selects the maximum year and month when selections occur in the State field.


Thanks

View solution in original post

7 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Talita,

I am always trying to simplify filters in nPrinting by putting a logic to Qlik.

What i would do in this case is create a Key build of Country&State&Date and i would flag keys with Maximum Date for each combination with 1 and for another I would put 0

see example script:

Fact:

Load

  Country,

  State,

  Date

Resident

  SomeTable

;

Left Join (Fact)

LOAD

  Country,

  State,

  Max(Date) as Date,

  1 as MyFlag

Resident

  Fact

Group by

  Country,

  State

;

Then in NPrinting i would have static filter selecting only MyFlag = 1

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.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

There should be a small adjustment to my formula as you only need a monthly buckets..

therefore i would change Date to MonthStart(Date)

like this

Fact:

Load

  Country,

  State,

  MonthStart(Date) as Date

Resident

  SomeTable

;

Left Join (Fact)

LOAD

  Country,

  State,

  Max(MonthStart(Date)) as Date,

  1 as MyFlag

Resident

  Fact

Group by

  Country,

  State

;

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.
avinashelite

Where you have implemented the dynamic date filter ? in the report level or Task level ?

it needs to be in the report level ...and check the expression your using

talita_verdes
Partner - Contributor III
Partner - Contributor III
Author

Hi Avinash!


I tested with the dynamic filter in the report, but it didn't work.


The expressions used are:


Year: =Year(Max(DATE))

Month: =Text(Month(Max(DATE)))

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

this is already confusing.

how do you know that month is actualy a text?

Month in general is a dual value which can be either 1 or Jan , 2 or Feb etc...

When you put "Text" function ahead of your formula you must be 100% sure your Month field in datamodel is a string/text

still

i strongly advice you to consider flagging your records as i have described above

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.
talita_verdes
Partner - Contributor III
Partner - Contributor III
Author

Good Afternon!


I found the solution.


I created a trigger in the State field that selects the maximum year and month when selections occur in the State field.


Thanks

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Talita,

great news!!

bad news is that triggers are not supported and as much as it works for you for unknown reasons they may stop working.

regards

Lech

https://help.qlik.com/en-US/nprinting/June2017/Content/GettingStarted/HowCreateConnections/Create-Co...

Unsupported QlikView documents

Before you create a connection to a QlikView document, ensure that the QlikView document does not use any of the following:

  • alternate states
  • sheet and document triggers
  • Always one selected list box property

Qlik NPrinting cannot modify or remove these options. As a result, Qlik NPrinting may not have access to the enitre dataset of the connected QlikView document during the cache generation process, and while generating reports.

QlikView documents that use these features, are not supported by Qlik NPrinting.

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.