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: 
Sai_Ice04
Contributor II
Contributor II

Display actual StartDate and EndDate in NPrinting report generated via OnDemand functionality

Hello Qlik Community! 

This question is similar to a request asked in this thread. 

https://community.qlik.com/t5/Qlik-NPrinting-Discussions/display-all-selections-with-getfieldselecti... 

But, let me explain the objective and some of the options that I tried, which may/may not be helpful for other folks having a similar problem.

Users / Customers would select a date range + other filters (e.g. UserID) and then generate its corresponding report via NPrinting Ondemand Report Generation within QlikSense. 

This works fine on a data level, but the main objective is that, we would also want to represent the start date and end date of the date range actually selected by the user in the NPrinting Report. But unfortunately, as confirmed in the link above, it just shows the start date and end date for which there is data. 

For e.g., We select the date range in QlikSense as 1/1/2019 - 12/31/2019 for a UserID and generate the corresponding NPrinting report via OnDemand functionality. But, the start date and end date in the NPrinting report shows as 5/1/2019 - 5/30/2019; because there is data only for that date range. 

Below are the options that I tried to circumvent this problem. 

  1. I created 2 variables in QlikSense which will extract the actual start date and end date that user selected via daterange; that is 1/1/2019 and 12/31/2019 using
    vStartDate=Date(TextBetween(GetFieldSelections(DateRangeField), '>=','<='))  -------> 1/1/2019
    vEndDate = Date(TextBetween(GetFieldSelections(DateRangeField), '<=','')) ----------> 12/31/2019
    I then tried to use the variable in Qlik NPrinting directly to print the vStartDate and vEndDate. Even though I understand that GetFieldSelections() doesn't pick the actual user inputted user daterange for OnDemand NPrint report, it is possible to get the actual start and end date using the above formula in QlikSense. Hence, I thought since no formula is computed within NPrinting, it would send the variable to Qlik Sense and thereby fetch the actual inputted start and end date; i.e. 1/1/2019 and 12/31/2019
    But, this did not work. 
  2. The other option I thought was to create 2 StartDate and EndDate data islands within my QlikSense model, ONLY for printing the actual input StartDate and EndDate in the NPrinting Report.
    I was wondering if there were any ways to pass the date values selected:
    Passing the value from StartDate and EndDate data island fields selected by user to then generate the daterange for the actual DateRange Field on which the data should be filtered.
    OR
    Passing the value from DateRange field the user selected to StartDate and EndDate data island fields which will represent the actual inputted Start Date and End Date in the NPrinting report.

Ultimately, the user should select the Date Range only ONCE while in QlikSense to generate the NPrinting report via OnDemand, but,  obviously that should not be the data islands StartDate and EndDate fields, because every single calculation becomes an unnecessary set analysis and the whole report becomes extremely slow (because now the DateRange field is not filtering the records).

To summarize, I have two not so ideal solutions for a seemingly simple problem.   

1. Utilize the Data islands StartDate and EndDate for getting the user daterange and store them in a variable and convert all of the formulae in all of the reports to complicated SetAnalysis formuale. (Phew!)

2. Ask the user to enter the DateRange twice within Qlik Sense! (i.e. once for the actual DateRange Field for filtering the records and secondly, for displaying the actual start and end date in the NPrinting Report). (But, user is not OK with this, and rightly so!)  

Any other alternatives which will allow the User to select the date range ONLY ONCE within Qlik Sense and still display the actual start and end date in NPrinting report (genrated via OnDemand) would be really appreciated!

Thank you!

Sai

Labels (2)
1 Solution

Accepted Solutions
Sai_Ice04
Contributor II
Contributor II
Author

Hi David, 

I did not find any better solution, so I went ahead with my first tedious option that I mentioned in my question. 

"Utilize the Data islands StartDate and EndDate for getting the user daterange and store them in a variable and convert all of the formulae in all of the reports to complicated SetAnalysis formuale" 

 

View solution in original post

4 Replies
David_Friend
Support
Support

Did you ever come up with a solution for this? You may wish to speak with your Qlik Account Manager, this might be something for Qlik Consulting/Professional Services

Sai_Ice04
Contributor II
Contributor II
Author

Hi David, 

I did not find any better solution, so I went ahead with my first tedious option that I mentioned in my question. 

"Utilize the Data islands StartDate and EndDate for getting the user daterange and store them in a variable and convert all of the formulae in all of the reports to complicated SetAnalysis formuale" 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I just had similar issue and I solved it by creating missing combinations of key fields required for selection. So if user needs to select Region, State, City and Date Range I make sure I have combinations of all possible keys (cartesian product with "where not exists" statement when loading)  added to fact table (without actual facts) .

Solution mentioned above is also ok if volume of data is too large to create all possible combinations of records. 

cheers

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.
Sai_Ice04
Contributor II
Contributor II
Author

Yes, in my case the data is too large. 

However, thank you so much for this suggestion! I will keep this in mind while building other future relatively smaller reports. 

Regards,

Sai