<?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: function with single parameter in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483117#M100994</link>
    <description>&lt;P&gt;The long execution times isn't a special matter of Qlik else it's caused from the inefficient way of performing the task. Regardless of the calling tool or API it couldn't be fast and I'm quite sure it's even slow within the source data-base with the method of looping through a longer list/array/table and initializing in each iteration variables + a procedure and storing the results anywhere.&lt;/P&gt;
&lt;P&gt;Each time multiple threads and handles are created which needs to be coordinated between the call and the data-base and the underlying OS + storage/network which will always have a latency of n milli/nano-seconds - and in the end the waiting/idle-times might be (much) bigger as the real processing times beside the fact that there is much redundancy in regard of initializing/checking all the variables + table-calls.&lt;/P&gt;
&lt;P&gt;The mentioned routine may be sensible by calling them from a front-end form for a single customer/product but they is IMO not suitable to create massive data-sets. Therefore my suggestion to do the essential processing in one place and all together - maybe just filtering the relevant tables with the list-table by an inner join and the applying on top the needed aggregation/transformations. The existing procedure should&amp;nbsp; be a valuable template to develop an appropriate new routine.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2024 06:03:53 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2024-09-24T06:03:53Z</dc:date>
    <item>
      <title>function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481200#M100798</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;I have below code running in qliksense to get the profit and margin for each ID from the fact table.&lt;/P&gt;
&lt;P&gt;I have total 300000 unique ID for each of them I am gettting profit&amp;nbsp; from database package.&lt;/P&gt;
&lt;P&gt;Problem is it is taking too much time which is offcourse because for each single ID it is getting connected to database package which has its own script and then as function it is returning its profit to the qliksense.&lt;/P&gt;
&lt;P&gt;I need to understand if there is any possible solution to fetch the records faster..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fact:&lt;/P&gt;
&lt;P&gt;LOAD&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FROM TEST.QVD;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For i=0 to fieldvaluecount('ID)'&lt;/P&gt;
&lt;P&gt;Let vFieldIDValue =FieldValue('ID','$(i)');&lt;/P&gt;
&lt;P&gt;Profit:&lt;/P&gt;
&lt;P&gt;LOAD*;&lt;/P&gt;
&lt;P&gt;Select ID, Profiltfrom table (&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;pkg.profilt&lt;/STRONG&gt;&lt;/FONT&gt;('$('vFieldIDValue '))&lt;/P&gt;
&lt;P&gt;NEXT;&lt;/P&gt;
&lt;P&gt;DROP TABLE FACT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, in above code the highlighted is the database package and profitmargin is the function which takes single ID from fact table as parameter and do its CALCULATION AND RETURN the result as profit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE: when we execute "Select ID, Profiltfrom table (&lt;FONT color="#FF00FF"&gt;pkg.profilt&lt;/FONT&gt;('$('vFieldIDValue '))" in database directly it takes very lesss time than the qliksense&lt;/STRONG&gt;&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>Thu, 12 Sep 2024 07:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481200#M100798</guid>
      <dc:creator>Tool_Tip</dc:creator>
      <dc:date>2024-09-12T07:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481306#M100817</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/300668"&gt;@Tool_Tip&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Don't you have in your Database an already calculated profit table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:17:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481306#M100817</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-09-12T13:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481666#M100857</link>
      <description>&lt;P&gt;Hi Mark,&lt;/P&gt;
&lt;P&gt;it could have table then it was not an issue for us. But unfortunately, it is getting calculated inside packages with function passing single parameter.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 04:02:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2481666#M100857</guid>
      <dc:creator>Tool_Tip</dc:creator>
      <dc:date>2024-09-16T04:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483000#M100978</link>
      <description>&lt;P&gt;With the above shown mix of measurements between Qlik and the data-base you couldn't speed up the performance. Therefore you need to transfer more essential logic into the data-base or if it's not wanted into Qlik.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 11:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483000#M100978</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-09-23T11:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483102#M100991</link>
      <description>&lt;P&gt;Thank you marcus for your valuable response but changing database because of qlik performance I do not think it's solution.&lt;/P&gt;
&lt;P&gt;Just need solution from qlik if it is possible because database is working fine and returning records within seconds...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 04:19:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483102#M100991</guid>
      <dc:creator>Tool_Tip</dc:creator>
      <dc:date>2024-09-24T04:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: function with single parameter</title>
      <link>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483117#M100994</link>
      <description>&lt;P&gt;The long execution times isn't a special matter of Qlik else it's caused from the inefficient way of performing the task. Regardless of the calling tool or API it couldn't be fast and I'm quite sure it's even slow within the source data-base with the method of looping through a longer list/array/table and initializing in each iteration variables + a procedure and storing the results anywhere.&lt;/P&gt;
&lt;P&gt;Each time multiple threads and handles are created which needs to be coordinated between the call and the data-base and the underlying OS + storage/network which will always have a latency of n milli/nano-seconds - and in the end the waiting/idle-times might be (much) bigger as the real processing times beside the fact that there is much redundancy in regard of initializing/checking all the variables + table-calls.&lt;/P&gt;
&lt;P&gt;The mentioned routine may be sensible by calling them from a front-end form for a single customer/product but they is IMO not suitable to create massive data-sets. Therefore my suggestion to do the essential processing in one place and all together - maybe just filtering the relevant tables with the list-table by an inner join and the applying on top the needed aggregation/transformations. The existing procedure should&amp;nbsp; be a valuable template to develop an appropriate new routine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 06:03:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/function-with-single-parameter/m-p/2483117#M100994</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-09-24T06:03:53Z</dc:date>
    </item>
  </channel>
</rss>

