<?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: Using NPrinting API in QlikSense  - GET Filters in Qlik NPrinting</title>
    <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777204#M31041</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Instead of running direct SQL that could be dangerous you could use:&lt;/P&gt;&lt;P&gt;- the Governance Dashboard&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-Governance-Dashboard/ta-p/1744538" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-Governance-Dashboard/ta-p/1744538&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- the official APIs&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/Extending/Intro-Extending.htm" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/Extending/Intro-Extending.htm&lt;/A&gt;&amp;nbsp;for example&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=58" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=58&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2021 16:01:08 GMT</pubDate>
    <dc:creator>Ruggero_Piccoli</dc:creator>
    <dc:date>2021-01-25T16:01:08Z</dc:date>
    <item>
      <title>Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777186#M31038</link>
      <description>&lt;P&gt;I am trying to get the table with all my current filters and their values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already gotten to the point of pulling all my users, and their corresponding filter selections, but getting the&amp;nbsp;&lt;STRONG&gt;values&lt;/STRONG&gt; of those filters is eluding me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a sample script for pulling the nested fields / values tables from the filters data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RestConnectionMasterTable:
SQL SELECT
"__KEY_data",
(SELECT
	"id" ,
	"name",
    "description",
    "enabled",
    "appId",
    "connectionId"
FROM "items" FK "__FK_items")
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "https://qlik-nprint.mycompany.cloud:4993/api/v1/filters", HTTPHEADER "cookie" "$(vCookie)",QUERY "Limit" "10000") );


NPrint_Filters:
NoConcatenate LOAD 
*
RESIDENT RestConnectionMasterTable;
drop table RestConnectionMasterTable;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 15:43:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777186#M31038</guid>
      <dc:creator>tm_burgers</dc:creator>
      <dc:date>2021-01-25T15:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777204#M31041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Instead of running direct SQL that could be dangerous you could use:&lt;/P&gt;&lt;P&gt;- the Governance Dashboard&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-Governance-Dashboard/ta-p/1744538" target="_blank"&gt;https://community.qlik.com/t5/Qlik-NPrinting-Documents/NPrinting-Governance-Dashboard/ta-p/1744538&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- the official APIs&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/Extending/Intro-Extending.htm" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/Extending/Intro-Extending.htm&lt;/A&gt;&amp;nbsp;for example&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=58" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2020/APIs/NP+API/index.html?page=58&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777204#M31041</guid>
      <dc:creator>Ruggero_Piccoli</dc:creator>
      <dc:date>2021-01-25T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777216#M31044</link>
      <description>&lt;P&gt;Thanks Ruggero,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I have not been able to troubleshoot my connection issues to the postgres server. But my REST API connection is working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The governance dashboard does not give enough details to run a full audit of filters to ensure that all are structured equally to give consistent results. I have the full data model working using the REST api, but getting the details from each filter is giving me difficulty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 16:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777216#M31044</guid>
      <dc:creator>tm_burgers</dc:creator>
      <dc:date>2021-01-25T16:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777338#M31048</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you customize the governance dashboard to met your requirements? In case you have questions about it you could ask on its community conversation.&lt;/P&gt;&lt;P&gt;If you need also to monitor the activities after execution, you can consider the audit trail &lt;A href="https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/AdministeringQVNprinting/Audit-trail.htm" target="_blank"&gt;https://help.qlik.com/en-US/nprinting/November2020/Content/NPrinting/AdministeringQVNprinting/Audit-trail.htm&lt;/A&gt;&amp;nbsp;that will be available via API from February 2021.&lt;/P&gt;&lt;P&gt;Please note that the structure of the repository could change in future versions (APIs have a system to manage the compatibility) so it could also be that you will be forced to update the solution.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ruggero&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 08:03:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777338#M31048</guid>
      <dc:creator>Ruggero_Piccoli</dc:creator>
      <dc:date>2021-01-26T08:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777409#M31050</link>
      <description>&lt;P&gt;Good Suggestions - I would also like to figure out my Governance Dashboard and troubleshoot my Postgres connection issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the meantime I ended figuring out the correct syntax for the filters.&amp;nbsp; It was just my first time working with an API and making SQL queries like this. Was hoping someone had already done the hard work!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;RestConnectionMasterTable:
SQL SELECT

"__KEY_data",

(SELECT

    "id" ,
	"name",
    "description",
    "enabled",
    "appId",
    "connectionId",
    "__KEY_items",
    "__FK_items",
    
    (SELECT 
    	"overrideValues",
        "name" as "FieldName",
    	"selectExcluded",
        "__KEY_fields",
		"__FK_fields",
        
        (SELECT 
        	"type",
            "value",
            "__FK_values"
        FROM "values" FK "__FK_values")
       
       
    FROM "fields" PK "__KEY_fields" FK "__FK_fields")
    

FROM "items" PK "__KEY_items" FK "__FK_items")

FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "https://qlik-nprint.killamreit.cloud:4993/api/v1/filters", HTTPHEADER "cookie" "$(vCookie)",QUERY "Limit" "10000") );


[Values]:
LOAD 
type as FilterType,
value as FilterValue,
[__FK_values] as Value_Field_Link
RESIDENT RestConnectionMasterTable
WHERE NOT IsNull([__FK_values]);

[Fields]:
LOAD 
overrideValues as FilterOverrideValues,
"FieldName" as FilterDimenson,
"selectExcluded" as FilterSelectExcluded,
__KEY_fields as Value_Field_Link,
__FK_fields as Field_Item_Link
RESIDENT RestConnectionMasterTable
WHERE NOT IsNull([__FK_fields]);

[NPrint_Filters]:
Load
    "id" as FilterID,
	"name" as FilterName,
    "description" as FilterDescription,
    "enabled" as FilterEnabled,
    "appId",
    "connectionId",
    "__KEY_items" as Field_Item_Link
RESIDENT RestConnectionMasterTable
WHERE NOT IsNull([__FK_items]);


left join (NPrint_Filters)
LOAD 
Field_Item_Link,
FilterDimenson,
FilterSelectExcluded,
FilterOverrideValues,
Value_Field_Link
Resident Fields;

left join (NPrint_Filters)
LOAD
Value_Field_Link,
FilterType,
FilterValue
Resident Values;


DROP TABLE Fields,Values,RestConnectionMasterTable;



//concatenate all filter values for each Dimension
TEXT_STEP1:
NoConcatenate LOAD Distinct
Value_Field_Link,
Field_Item_Link,
if(LastValue(FilterType)='text',
'['&amp;amp;LastValue(FilterDimenson)&amp;amp;']={'&amp;amp;concat(distinct FilterValue,',')&amp;amp;'}'&amp;amp;if(LastValue(FilterSelectExcluded)='True','&amp;lt;excluded&amp;gt;')
)
as FilterValues_Text1,
if(LastValue(FilterType)='number',
'['&amp;amp;LastValue(FilterDimenson)&amp;amp;']={'&amp;amp;concat(distinct FilterValue,',')&amp;amp;'}'&amp;amp;if(LastValue(FilterSelectExcluded)='True','&amp;lt;excluded&amp;gt;')
)
as FilterValues_Number1

Resident NPrint_Filters
group by Value_Field_Link,Field_Item_Link;
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 12:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777409#M31050</guid>
      <dc:creator>tm_burgers</dc:creator>
      <dc:date>2021-01-26T12:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777557#M31059</link>
      <description>&lt;P&gt;My NPrinting.qvs has it:&amp;nbsp;&lt;A href="https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/" target="_blank"&gt;https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;//  Get Filters

                RestConnectionFiltersTable:
                SQL SELECT
                    "__KEY_data",
                    (SELECT
                        "id",
                        "name",
                        "appId",
                        "__PK_items",
                        "__FK_items",
                        (SELECT
                            "overrideValues",
                            "connectionId",
                            "name" as "Fieldname", 
                            "__PK_fields",
                            "__FK_fields"
                            ,(SELECT
                                "type",
                                "value",
                                "__PK_values",
                                "__FK_values"
                        FROM 
                            "values" PK "__PK_values" FK "__FK_values")
                        FROM 
                            "fields" PK "__PK_fields" FK "__FK_fields")
                    FROM 
                        "items" PK "__PK_items" FK "__FK_items")
                FROM 
                    JSON (wrap off) "data" PK "__KEY_data"
                WITH 
                    CONNECTION( URL "$(vURL_Filters)", HTTPHEADER "cookie" "$(vCookie)", QUERY "Limit" "$(vQueryLimit)")
                ;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 22:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777557#M31059</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2021-01-26T22:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777563#M31060</link>
      <description>Thanks Lech, I found your post and scripts too late after I had already gotten into it.&lt;BR /&gt;I have found them now, and we actually had some post dialogue on your site as well.&lt;BR /&gt;&lt;BR /&gt;Thank you for your support!&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jan 2021 00:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777563#M31060</guid>
      <dc:creator>tm_burgers</dc:creator>
      <dc:date>2021-01-27T00:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using NPrinting API in QlikSense  - GET Filters</title>
      <link>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777585#M31061</link>
      <description>&lt;P&gt;all good - cheers&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 04:17:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-NPrinting/Using-NPrinting-API-in-QlikSense-GET-Filters/m-p/1777585#M31061</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2021-01-27T04:17:09Z</dc:date>
    </item>
  </channel>
</rss>

