Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Partner
Partner

NPrinting - Loop and Reduce?

Hi,

I'm new to NPrinting and would like to get some best practices for our initial batch of reports.

Before NPrinting, we had a macro set up that would do a loop and reduce on a QVW creating and sending a report to each sales rep (the reduce field).

In NPrinting, I'm trying to figure out the best way to emulate this loop and reduce functionality.

My initial thought would be to import all sales reps as recipients and give them a filter of themselves (hopefully there would be an easy way to import this filter with each recipient).

Is this the best way or are there other approaches.

Thanks

1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: NPrinting - Loop and Reduce?

Mark,

If your objective is to build a standard report which is distributed to many people and you want each person to receive the report with data is specific to them then your original idea is best practice.


Here's a concrete example:


You have many sales people, each of whom covers a single territory. Each sales person should receive a report, but the data in the report should be specific to their sales territory.


This is how to achieve that result


You import the sales people through a recipients import task (or build a table in your QVW with all the information - see the "recipients export" tab in the attached). Be sure to put them into a recipients "group" as part of that import.


Create a recipients import task so that you can schedule regular updates


Create a report task and add the "group" as one of the recipients. Add the report(s) to the task.


When you execute the report task, each recipient will receive the report(s) but their reports will only have the data that they are "allowed" to see as determined by the filters created during the recipient import.


NPrinting can import recipients from files (txt, excel, xml...), databases (oracle, sql server...), QVWs.


The following tutorials will probably be helpful:

Recipient import:

How to Create and Import Recipients with Filters and Distribution Groups


For more on import syntax there's a list of tutorials here:

QlikView NPrinting Tutorials - Recipients & Users


Setting up the Task:


How to Create Tasks



More on distribution here:


QlikView NPrinting Tutorials - Distribution, Schedules and Automation

Best


Aran Nathanson

View solution in original post

10 Replies
Highlighted

Re: NPrinting - Loop and Reduce?

Highlighted

Re: NPrinting - Loop and Reduce?

This is another good link for more NPrinting stuff.

QlikView NPrinting Tutorials by Subject

Highlighted
lubicz99
Valued Contributor

Re: NPrinting - Loop and Reduce?

Hi Mark,

Lets start with what output template you will be using.  Do you need to send to a PDF or Excel Spreadsheet?

Are there multiple charts and tables or just one in your output?

Importing recipients is pretty straightforward, but you need to decide if each person will get their own task or if you can just cycle through salesperson name dimension with one task.

Is this a process you are going to schedule or can you allow each person to go in and run it on demand from the application?

How often do you generate the reports?

NPrinting has many paths to creating your output based on the answers to these questions.

Hope that gave you some things to think about.

Mike


Highlighted
MVP
MVP

Re: NPrinting - Loop and Reduce?

You don't have to emulate Loop and Reduce.

You can use a field as a CYCLE which is equivalent to looping over a variable. The cycle should be on the report as such.

Cycles can be created various places inside reports too - so for your purpose the report is the place to do the cycling.

Make sure that the field sales rep you CYCLE over will select the data and only the data for the particular sales rep.

Then the report will be created as if a reduction was performed because of the associate logic.

It is very simple and straightforward.

Highlighted
Partner
Partner

Re: NPrinting - Loop and Reduce?

Excellent information.  Thanks!

Highlighted
Partner
Partner

Re: NPrinting - Loop and Reduce?

I'm still trying to get my head around how NPrinting works, but to start we just are going to send the same Excel report, which is based on one QVW, to each Sales Rep. 

We will be scheduling these reports to run every evening.

When you say that each person could get their own task, what is that referring to?  My initial thought was to have a single report that is "called" by a single task that had all the recipients attached to it.  Each recipient would have a filter of himself that would reduce the data when creating their report.

I'm not sure if this is the best way, but I don't see another way to accomplish it.  Again, I've only been playing with NPrinting for a couple of days and from what I can tell there is a lot to learn!

Highlighted
Not applicable

Re: NPrinting - Loop and Reduce?

Mark,

If your objective is to build a standard report which is distributed to many people and you want each person to receive the report with data is specific to them then your original idea is best practice.


Here's a concrete example:


You have many sales people, each of whom covers a single territory. Each sales person should receive a report, but the data in the report should be specific to their sales territory.


This is how to achieve that result


You import the sales people through a recipients import task (or build a table in your QVW with all the information - see the "recipients export" tab in the attached). Be sure to put them into a recipients "group" as part of that import.


Create a recipients import task so that you can schedule regular updates


Create a report task and add the "group" as one of the recipients. Add the report(s) to the task.


When you execute the report task, each recipient will receive the report(s) but their reports will only have the data that they are "allowed" to see as determined by the filters created during the recipient import.


NPrinting can import recipients from files (txt, excel, xml...), databases (oracle, sql server...), QVWs.


The following tutorials will probably be helpful:

Recipient import:

How to Create and Import Recipients with Filters and Distribution Groups


For more on import syntax there's a list of tutorials here:

QlikView NPrinting Tutorials - Recipients & Users


Setting up the Task:


How to Create Tasks



More on distribution here:


QlikView NPrinting Tutorials - Distribution, Schedules and Automation

Best


Aran Nathanson

View solution in original post

Highlighted

Re: NPrinting - Loop and Reduce?

Yup.  You describe the best way to do it.

This link explains how to do it :

How to Add Filters to Recipients

Highlighted
Partner
Partner

Re: NPrinting - Loop and Reduce?

Thanks to everyone.  All the information given has been extremely helpful.

I'm really starting to see the cool stuff NPrinting is going to allow us to do!