<?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: Can we 'Reduce Data' with 'Keep Possible Values' in Qlik Sense ? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1928060#M76429</link>
    <description>&lt;P&gt;Yes, there is a valid option that only requires LOAD-script. PS. I posted this answer in another thread as well, but I think this could be the solution here as well...&lt;/P&gt;
&lt;P&gt;I have tested to do this in just the load-script at the "end" of the applications load-script. &lt;FONT color="#339966"&gt;&lt;STRONG&gt;It works perfectly&lt;/STRONG&gt;&lt;/FONT&gt;, it even works in combination with Section Access. I will just explain the concept.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Prerequisites: &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;Needs developer that is able to do "Advanced"? LOAD-script programming.&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Big advantages:&lt;/FONT&gt; &lt;FONT color="#000000"&gt;JUST "simple" LOAD-script.&lt;/FONT&gt;&lt;/STRONG&gt; NO Section Access is needed for reduction. NO use of any API.&lt;/P&gt;
&lt;P&gt;PS. I only tested it with 1 Field. But I think it should work, even with more than one field easily if the fields are in the same table, otherwise it could become to complex.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;The implementation/concept (working!):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Write a LOAD script that you put at the END (but before possible Section Access script). The script should contain the following steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Find the "Main" table that contains the field you want to reduce on.&lt;/LI&gt;
&lt;LI&gt;Do a Resident-load from this table with a WHERE-clause based on your Reduce-field-filter. Now the "Main" table is reduced.&lt;/LI&gt;
&lt;LI&gt;Find all tables that have a DIRECT relation to the "Main" table, BUT EXCLUDE the "Main" table itself (that already has been reduced). Do a Resident-load with a LEFT KEEP ("Main" table) on all of these tables. Now these tables have been reduced.&lt;/LI&gt;
&lt;LI&gt;Find all tables that have a DIRECT relation to the above tables (see 3), BUT always EXCLUDE all tables that already have been reduced (e.g. keep av variable that contains a list of your already excluded tables).&lt;/LI&gt;
&lt;LI&gt;Repeat STEP 4 until there are no more tables left to reduce...&lt;/LI&gt;
&lt;LI&gt;You now have an application that contains REDUCED data.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Some implementation thoughts:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Write a LOAD script that can be placed/injected in every app (Execute/Call it at the end of the load script (BUT before any Section Access)) in the application.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Have a configuration-file in some folder that contains your Reduce-information. You probably need the app-id, fieldname and the value(s) you want to keep in the data-model. &lt;BR /&gt;&lt;BR /&gt;PS You should also be able to able to Reduce based on combination of STREAM-name AND application-id. You can find the stream name (in the load-script) by running this SQL (SQL SELECT "ID", "Name" FROM "QSR"."public"."Streams";) against the QlikRepository Database.&lt;/LI&gt;
&lt;LI&gt;To speed up things, run just a Binary LOAD from the "mother"-app (if possible) and after that execute your script.&lt;/LI&gt;
&lt;LI&gt;There are advantages/disadvantages, JUST LIKE with Section Access. It depends on your situation...&lt;/LI&gt;
&lt;LI&gt;To find all relations between all tables use something like the following script (OBS! Remove all records where TABLE1 = TABLE2) :&lt;BR /&gt;ALL_TABLES_AND_FIELD_RELATIONS:&lt;BR /&gt;Load&lt;BR /&gt;AppTable AS TABLE1&lt;BR /&gt;,AppField AS THEFIELD&lt;BR /&gt;Resident TABLESANDFIELDSINAPP&lt;BR /&gt;;&lt;BR /&gt;INNER JOIN (ALL_TABLES_AND_FIELD_RELATIONS)&lt;BR /&gt;Load&lt;BR /&gt;AppTable AS TABLE1&lt;BR /&gt;,AppField AS THEFIELD&lt;BR /&gt;Resident TABLESANDFIELDSINAPP&lt;BR /&gt;;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2022 14:42:38 GMT</pubDate>
    <dc:creator>Johannes_Twisk</dc:creator>
    <dc:date>2022-05-09T14:42:38Z</dc:date>
    <item>
      <title>Can we 'Reduce Data' with 'Keep Possible Values' in Qlik Sense ?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1654514#M48910</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Do we have the 'Reduce Data' with 'Keep Possible Values' functionality in Qlik Sense, like we had in QlikView&amp;nbsp; (anything apart from the ODAG option)?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Image 047.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/24975iFC92A3C5AC971FB3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Image 047.png" alt="Image 047.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;or Do we have an API that will help us achieve this functionality?&lt;/P&gt;&lt;P&gt;We have a big application that we would like to split into multiple small apps based on custom Selected + Possible Values, any pointers would be helpful.&lt;/P&gt;&lt;P&gt;Ideally we would like to do this reduction on a scheduled basis (similar to the loop and reduce functionality)..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;KD&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 11:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1654514#M48910</guid>
      <dc:creator>kdandekar</dc:creator>
      <dc:date>2019-12-05T11:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can we 'Reduce Data' with 'Keep Possible Values' in Qlik Sense ?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1654521#M48912</link>
      <description>&lt;P&gt;I don't see such so far, have a look&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Reduce_Data1.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Reduce_Data1.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 11:16:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1654521#M48912</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-12-05T11:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can we 'Reduce Data' with 'Keep Possible Values' in Qlik Sense ?</title>
      <link>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1928060#M76429</link>
      <description>&lt;P&gt;Yes, there is a valid option that only requires LOAD-script. PS. I posted this answer in another thread as well, but I think this could be the solution here as well...&lt;/P&gt;
&lt;P&gt;I have tested to do this in just the load-script at the "end" of the applications load-script. &lt;FONT color="#339966"&gt;&lt;STRONG&gt;It works perfectly&lt;/STRONG&gt;&lt;/FONT&gt;, it even works in combination with Section Access. I will just explain the concept.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Prerequisites: &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;Needs developer that is able to do "Advanced"? LOAD-script programming.&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Big advantages:&lt;/FONT&gt; &lt;FONT color="#000000"&gt;JUST "simple" LOAD-script.&lt;/FONT&gt;&lt;/STRONG&gt; NO Section Access is needed for reduction. NO use of any API.&lt;/P&gt;
&lt;P&gt;PS. I only tested it with 1 Field. But I think it should work, even with more than one field easily if the fields are in the same table, otherwise it could become to complex.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;The implementation/concept (working!):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Write a LOAD script that you put at the END (but before possible Section Access script). The script should contain the following steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Find the "Main" table that contains the field you want to reduce on.&lt;/LI&gt;
&lt;LI&gt;Do a Resident-load from this table with a WHERE-clause based on your Reduce-field-filter. Now the "Main" table is reduced.&lt;/LI&gt;
&lt;LI&gt;Find all tables that have a DIRECT relation to the "Main" table, BUT EXCLUDE the "Main" table itself (that already has been reduced). Do a Resident-load with a LEFT KEEP ("Main" table) on all of these tables. Now these tables have been reduced.&lt;/LI&gt;
&lt;LI&gt;Find all tables that have a DIRECT relation to the above tables (see 3), BUT always EXCLUDE all tables that already have been reduced (e.g. keep av variable that contains a list of your already excluded tables).&lt;/LI&gt;
&lt;LI&gt;Repeat STEP 4 until there are no more tables left to reduce...&lt;/LI&gt;
&lt;LI&gt;You now have an application that contains REDUCED data.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Some implementation thoughts:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Write a LOAD script that can be placed/injected in every app (Execute/Call it at the end of the load script (BUT before any Section Access)) in the application.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Have a configuration-file in some folder that contains your Reduce-information. You probably need the app-id, fieldname and the value(s) you want to keep in the data-model. &lt;BR /&gt;&lt;BR /&gt;PS You should also be able to able to Reduce based on combination of STREAM-name AND application-id. You can find the stream name (in the load-script) by running this SQL (SQL SELECT "ID", "Name" FROM "QSR"."public"."Streams";) against the QlikRepository Database.&lt;/LI&gt;
&lt;LI&gt;To speed up things, run just a Binary LOAD from the "mother"-app (if possible) and after that execute your script.&lt;/LI&gt;
&lt;LI&gt;There are advantages/disadvantages, JUST LIKE with Section Access. It depends on your situation...&lt;/LI&gt;
&lt;LI&gt;To find all relations between all tables use something like the following script (OBS! Remove all records where TABLE1 = TABLE2) :&lt;BR /&gt;ALL_TABLES_AND_FIELD_RELATIONS:&lt;BR /&gt;Load&lt;BR /&gt;AppTable AS TABLE1&lt;BR /&gt;,AppField AS THEFIELD&lt;BR /&gt;Resident TABLESANDFIELDSINAPP&lt;BR /&gt;;&lt;BR /&gt;INNER JOIN (ALL_TABLES_AND_FIELD_RELATIONS)&lt;BR /&gt;Load&lt;BR /&gt;AppTable AS TABLE1&lt;BR /&gt;,AppField AS THEFIELD&lt;BR /&gt;Resident TABLESANDFIELDSINAPP&lt;BR /&gt;;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Can-we-Reduce-Data-with-Keep-Possible-Values-in-Qlik-Sense/m-p/1928060#M76429</guid>
      <dc:creator>Johannes_Twisk</dc:creator>
      <dc:date>2022-05-09T14:42:38Z</dc:date>
    </item>
  </channel>
</rss>

