Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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
;
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
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)))
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
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
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
Before you create a connection to a QlikView document, ensure that the QlikView document does not use any of the following:
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.