<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Advanced Search / Date Range via the NPrinting API in Qlik NPrinting</title>
    <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742425#M29965</link>
    <description>&lt;P&gt;Thank you again for such a quick response! Let me know what you find.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 13:30:40 GMT</pubDate>
    <dc:creator>ralphjjr</dc:creator>
    <dc:date>2020-09-09T13:30:40Z</dc:date>
    <item>
      <title>Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742107#M29953</link>
      <description>&lt;P&gt;The shortest form of my question is - is it possible to apply an Advanced Search on a field via the NPrinting API? For example, a date range.&lt;/P&gt;&lt;P&gt;Here is a filter applied to a report. This works great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ralphjjr_0-1599588059948.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40235iAA19C4DBA6F6E3C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ralphjjr_0-1599588059948.png" alt="ralphjjr_0-1599588059948.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But obviously we use the API for some other integrations and on demand report creation from other applications. I've tried a few variations of our API calls to mimic this, but I can't seem to nail down the right one. I actually wrote an even longer post just a few minutes ago, and when I went to post it the website gave me an auth error and lost my post. So this is a much shorter one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been through the API documentation, and I&amp;nbsp; can see that there is a FilterField and FilterFieldValue, but can't quite figure out how to use them the right way. All of our current requests take the following form:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"config": {
		"reportId": "report-guid-id",
		"outputFormat": "PDF"
	},
	"filters": null,
	"selections": [{
		"fieldName": "SOME_TEXT_FIELD",
		"selectedCount": 1,
		"selectedValues": ["this_value"],
		"isNumeric": false
	}],
	"connectionId": "connection-guid-id",
	"type": "report"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attempted a few variations, but I'm not getting it right.&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 19:15:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742107#M29953</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-08T19:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742201#M29958</link>
      <description>&lt;P&gt;Hi. this is not an easy part.&lt;/P&gt;&lt;P&gt;So they way it works is that you first need to create filter and then associate that filter with entity. The problem I can see here sits in the fact that there is no endpoint to associate filter with report. There is only endpoint associating filters to users though. If your aim is to create a filter and associate it with report or task then it is not available via the api/v1 endpoint. Instead you can use npe api which is not documented and not supported, but it is used by nprinting admin console interface. You can learn from there structure of the payloads required by inspecting them in browser developer tools&lt;/P&gt;&lt;P&gt;but to cut story short here are the steps you can do via API:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create filter&lt;/LI&gt;&lt;LI&gt;based on what you see below you need to provide valid app id , valid connection Id and name of the existing Field in that connection.&lt;/LI&gt;&lt;LI&gt;once you execute below using post method (https://yourNPrintingServer:4993/api/v1/filters) you should see new filter created in filters&lt;/LI&gt;&lt;LI&gt;{&lt;BR /&gt;"appId": "ab53ef11-3cdc-45af-9403-b788eba2b004",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"name": "Created via API",&lt;BR /&gt;"description": "Example of a filter created via API Postman",&lt;BR /&gt;"fields": [&lt;BR /&gt;{&lt;BR /&gt;"connectionId": "226546c7-0513-4575-8c39-1f598dd4e2a8",&lt;BR /&gt;"name": "Dim1",&lt;BR /&gt;"overrideValues": false,&lt;BR /&gt;"selectExcluded": false,&lt;BR /&gt;"values": [&lt;BR /&gt;{&lt;BR /&gt;"value": "A",&lt;BR /&gt;"type": "text"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"value": "2",&lt;BR /&gt;"type": "number"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"variables": []&lt;BR /&gt;}&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;as per types everything is described in documentation:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/June2020/APIs/NP+API/index.html?page=79" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/June2020/APIs/NP+API/index.html?page=79&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 00:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742201#M29958</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2020-09-09T00:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742395#M29962</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp; thank you so much for the quick response.&lt;/P&gt;&lt;P&gt;So, at the moment, there is no way to just pass in a range, numeric, or date, into a report using the API?&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"config": {
		"reportId": "report-guid-id",
		"outputFormat": "PDF"
	},
	"filters": null,
	"selections": [{
		"fieldName": "SOME_TEXT_FIELD",
		"selectedCount": 1,
		"selectedValues": ["this_value"],
		"isNumeric": false
	}, {
		"fieldName": "DATE_RANGE",
		"selectedCount": 1,
		"selectedValues": ["&amp;gt;1/1/2020&amp;lt;1/5/2020"],
		"isNumeric": false
	}],
	"connectionId": "conn-guid-id",
	"type": "report"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or even like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"config": {
		"reportId": "report-guid-id",
		"outputFormat": "PDF"
	},
	"filters": null,
	"selections": [{
		"fieldName": "SOME_TEXT_FIELD",
		"selectedCount": 1,
		"selectedValues": ["this_value"],
		"isNumeric": false
	}, {
		"fieldName": "DATE_RANGE",
		"selectedCount": 1,
		"selectedValues": ["=(DATE_RANGE&amp;gt;1/1/2020)*(DATE_RANGE&amp;lt;1/5/2020)"],
		"isNumeric": false
	}],
	"connectionId": "conn-guid-id",
	"type": "report"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or this, I had read the API documentation section about using filters with an On Demand call. This:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/nprinting/November2019/APIs/NP+API/index.html?page=78" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2019/APIs/NP+API/index.html?page=78&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"config": {
		"reportId": "report-guid-id",
		"outputFormat": "PDF"
	},
	"filters": [{
		"additionalFilters": [{
			"connectionId": "conn-guid-id",
			"name": "DATE_RANGE",
			"values": [{
				"value": "&amp;gt;1/1/2020&amp;lt;1/5/2020",
				"type": "advancedsearch"
			}]
		}]
	}],
	"selections": [{
		"fieldName": "SOME_TEXT_FIELD",
		"selectedCount": 1,
		"selectedValues": ["SOME_VALUE"],
		"isNumeric": false
	}],
	"connectionId": "conn-guid-id",
	"type": "report"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That one seemed the most promising, since the documentation clearly mentions that you can do an advanced search. But what I'm not getting correct is the format of the JSON.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 12:26:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742395#M29962</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-09T12:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742410#M29963</link>
      <description>&lt;P&gt;Apologies-for some reason i did not consider ondemand&lt;/P&gt;&lt;P&gt;i will see what i can do tomorrow and will get back to you.&amp;nbsp;&lt;BR /&gt;cheers&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 12:48:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742410#M29963</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2020-09-09T12:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742425#M29965</link>
      <description>&lt;P&gt;Thank you again for such a quick response! Let me know what you find.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 13:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742425#M29965</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-09T13:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742624#M29978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/125591"&gt;@ralphjjr&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked at documentation and at the way OnDemand seems to work. My understanding is that with the OnDemand endpoint you are required to provide array of explicit values you want to select in your Qlik application, so there is no advanced search syntax you can apply in your payload.&lt;/P&gt;&lt;P&gt;Now, when I thought about it longer it actually makes sense to me as typically you would first apply selections in your QlikView/Qlik Sense app. At this stage you would use advanced search to apply this selection on app and the next step would be to get selected values from the field. Once you get those values you then pass them to you the "values[]" array.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope this makes sense&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 03:33:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742624#M29978</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2020-09-10T03:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742627#M29980</link>
      <description>&lt;P&gt;Thank you again for the response&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1326"&gt;@Lech_Miszkiewicz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I do understand. If I am in QlikView/QlikSense, I've made my selections, whether by clicking, or selecting a range, or using an advanced search. If I then were to call the NPrinting AP, I can easily provide the explicit values because they have already been selected by Qlik.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my current use case, however, NPrinting is being called from a different application. NPrinting then calls Qlik, makes the selections and then NPrinting can provide a report to print. We pass in a variety of explicit values that the other application is aware of. However, presently dates are being passed in as two separate selections, and then in Qlik, with the help of a variable, set analysis is used for many calculations. I've been optimizing the Qlik data models and the NPrinting reports, and the set analysis is totally unnecessary from Qlik's perspective. I was hoping it was also unnecessary in NPrinting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;A href="https://help.qlik.com/en-US/nprinting/November2019/APIs/NP+API/index.html?page=78" target="_self"&gt;FilterField&lt;/A&gt; and &lt;A href="https://help.qlik.com/en-US/nprinting/November2019/APIs/NP+API/index.html?page=79" target="_self"&gt;FilterFieldValue&lt;/A&gt; models give me some hope that an advanced search should be possible via the API. I just can't figure out the context in which to use them. Are these for something different entirely?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 04:04:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742627#M29980</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-10T04:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742628#M29981</link>
      <description>&lt;P&gt;Yes. These models are used to create Nprinting Filters in Nprinting and are not used with OnDemand calls.&amp;nbsp;&lt;BR /&gt;I initially referred in my first response, but use case is different.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 04:17:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742628#M29981</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2020-09-10T04:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742629#M29982</link>
      <description>I see. I understand what you meant in the beginning. Presumably a filter could created, then applied to a report so it could be run. Seems like it would work, but definitely more steps than we take now. I’m going to try it and see if it works.&lt;BR /&gt;&lt;BR /&gt;Thank you again for the help!&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2020 04:25:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742629#M29982</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-10T04:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742702#M29985</link>
      <description>&lt;P&gt;as I mentioned in my initial reply there is no endpoint to associate filter to report with current api, so I am not sure if it is worth trying...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 08:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742702#M29985</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2020-09-10T08:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742770#M29989</link>
      <description>&lt;P&gt;oh, right!&lt;/P&gt;&lt;P&gt;What a bummer. This seems like something common that we'd want to do. Select a range.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thinking_face:"&gt;🤔&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 11:18:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742770#M29989</guid>
      <dc:creator>ralphjjr</dc:creator>
      <dc:date>2020-09-10T11:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Advanced Search / Date Range via the NPrinting API</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742863#M29993</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could the following work for you?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Manually create a filter and copy its Id&lt;/LI&gt;&lt;LI&gt;Associate the filter to the report (or other entity where you need it)&lt;/LI&gt;&lt;LI&gt;Change the filter by using the API&amp;nbsp;PUT /filters/{id}&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/June2020/APIs/NP+API/index.html?page=20#OnDemand" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/nprinting/June2020/APIs/NP+API/index.html?page=20#OnDemand&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Via PUT you can change the advanced search parameters:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PUT Filter - Upgrade an existing filter.png" style="width: 653px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/40360iE473E236FB64DC75/image-size/large?v=v2&amp;amp;px=999" role="button" title="PUT Filter - Upgrade an existing filter.png" alt="PUT Filter - Upgrade an existing filter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 13:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Advanced-Search-Date-Range-via-the-NPrinting-API/m-p/1742863#M29993</guid>
      <dc:creator>Ruggero_Piccoli</dc:creator>
      <dc:date>2020-09-10T13:45:48Z</dc:date>
    </item>
  </channel>
</rss>

