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: 
geertdeman
Contributor III
Contributor III

display all selections with getfieldselections

I'm using the function GetFieldSelections() in nprinting to show the selected filters in my qliksense app.   Nprinting is only showing the selected values that contains data.  Example: 2 filters period and country:  if i select April 2019 for period and country US and Belgium as countries and there is only data for US in April 2019 the nprinting report will only show US.   We need to display what is selected in the filters on the nprinting reports.   When I use that same function in Qliksense it displays both countries .

21 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

It may not be in filter selections for many reasons:

  • you could have "typo" in your NPrinting filter
  • you could use wrong filter type ("numerical value is", "evaluate", "value is") in your NPrinting filter
  • field could be loaded as "Dual" type and can require numerical value is filter
  • there could be "whitespaces" in your text - trimming it could solve issue

these few are just from top of my head

You have never shown us how you create your NPrinting filter - maybe problem sits there? 

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

I don't use a nprinting filter.  It is an nprinting report on demand that is started from the qliksense app and should include the filters that are used in the qliksense app

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Ok. Well - you should have said that you are using OnDemand in the first place as filters are passed differently there. That changes completly our conversation.

So in this situation OnDemand extension passes filters to NPrinting as an intersection of all applied filters. That is why you only see in your current selection box only values which are "GREEN" on your filter panes at the time when you generate report. In your case value "INVALID" is actually excluded from selection.

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

sorry that I forgot to mention that it is an on demand report.  Is there any solution to show what is selected in nprinting?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

well - it will no tbe possible to show that "INVALID" is selected but not available in current selection.

Instead you can change in Qlik Sense the way you present your current selections to only show actually available values.

For example like: Concat(Distinct INFORM_COMP_INFORM_COMP_TYPE, ', ') 

 

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

Hi,

I did some tests and I always have the same results in the On-Demand generated report and Qlik Sense app. 

Best Regards,

Ruggero



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

Hi Ruggero @Ruggero_Piccoli,

 

Try testing follwoing scenario:

Create an app which will have a dates and week day names like: Mon,Tue,Wed etc.

Then apply selcetions:

  • for weekday select few, lets say: Mon,Tue,Wed
  • for Date field select 1 Date, lets say: 27/05/2019

now - for this selection directly in Qlik Sense result of GetCurrentSelections function will be:

  • Weekday:  Mon,Tue,Wed
  • Date: 27/05/2019

However if you run OnDeman report and have GetCurrentSelections NPrinting formula in it it will evaluate differently and it will show:

  • Weekday:  Mon,
  • Date: 27/05/2019

The reson for it seems to sit in how selections are passed and applied via API.

It would be great to hear your thoughts after this test. 

Thanks

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

Hello! @Lech_Miszkiewicz ; @geertdeman ; @Ruggero_Piccoli 

Just wanted to check-in and see if there is a solution to this problem ? If not, were there any alternate methods for this issue. I am having a very similar use case. Any help / insight would be much appreciated!

Thank you! 

Ruggero_Piccoli
Support
Support

Hi,

I did some tests and I confirm that if you insert a GetCurrentSelections() function in a template when you generate the report in Qlik NPrinting you will see the full list of selected values. Instead the same report created via On-Demand will show only the intersection of the filters. 

Best Regards,

Ruggero



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

@geertdeman @Ruggero_Piccoli @Lech_Miszkiewicz  Thank you so much for your response!

I just don't want to give up on this ‌! 😔
Let me explain the objective and some of the options that I tried:

Report users would select a date range + other filters and then generate its corresponding report via NPrinting Ondemand Report Generation within QlikSense. 

This works perfectly, but the main objective is we would also want to represent the start date and end date of the date range selected. But unfortunately, as discussed before, 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. Unfortunately, that is by design. 
Below are the options that I tried to circumvent this problem. 

  1. I created a variable 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 vFromDate and vToDate. Even though I understand that GetFieldSelections() doesn't work for OnDemand NPrint report, I thought since no formula is computed within NPrinting, it would send the variable to Qlik Sense and thereby fetch the inputted start and end date; i.e. 1/1/2019 and 12/31/2019
    Right ? 
  2. The other option 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 fields selected by user to then generate the daterange for the 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 only select the Date Range 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 slow (because now the DateRange field is not filtering the records).


Any insight/direction would be really helpful. Thank you!