<?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 Use Qlik Sense fields to send SQL query to Postgres server in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Use-Qlik-Sense-fields-to-send-SQL-query-to-Postgres-server/m-p/2007564#M83369</link>
    <description>&lt;P&gt;Hi community!&lt;/P&gt;
&lt;P&gt;I am developing a Qlik Sense app and in my script I would like to send a SQL query to Postgres with Qlik fields in order to execute it and send me back the results to be displayed in Qlik.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table loaded in Qlik Sense, which has 3 columns (numeric values (double precision in SQL language)). What I want to do is to call a function declared in Postgres and use the 3 fields as arguments to the functions. The problem is that the function only accepts single values, I want to execute it for every record in my Qlik table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my table in Qlik :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | C&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;220.2&amp;nbsp; &amp;nbsp;| 250.0&amp;nbsp; | 250&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;250.6&amp;nbsp; &amp;nbsp;| 280.0 | 300&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;250.9&amp;nbsp; | 290.0&amp;nbsp; | 320&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to execute this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ST_Transform(st_pointz("A","B","C",9895), 4937)&lt;/EM&gt; for every record and get the result in a table.&lt;/P&gt;
&lt;P&gt;So, i need to have in a new table, these results :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("220.2"&amp;nbsp; , "250.0" , "250", 9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("250.6"&amp;nbsp; &amp;nbsp;, "280.0" , "300", 9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("250.9" ,&amp;nbsp; "290.0"&amp;nbsp; , "320",9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I did &lt;STRONG&gt;one solution&lt;/STRONG&gt;, which consists of looping over the table and getting the "i" value, send the request to postgres and get the data in a table, then increment the i and do the same thing with the next line... It does the job, but when in production I will have thousands or millions of record data, it is going to be so heavy and it will have a negative impact on the performance !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please, can you help me with a few hints ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 12:45:48 GMT</pubDate>
    <dc:creator>mab_koz</dc:creator>
    <dc:date>2022-11-22T12:45:48Z</dc:date>
    <item>
      <title>Use Qlik Sense fields to send SQL query to Postgres server</title>
      <link>https://community.qlik.com/t5/App-Development/Use-Qlik-Sense-fields-to-send-SQL-query-to-Postgres-server/m-p/2007564#M83369</link>
      <description>&lt;P&gt;Hi community!&lt;/P&gt;
&lt;P&gt;I am developing a Qlik Sense app and in my script I would like to send a SQL query to Postgres with Qlik fields in order to execute it and send me back the results to be displayed in Qlik.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table loaded in Qlik Sense, which has 3 columns (numeric values (double precision in SQL language)). What I want to do is to call a function declared in Postgres and use the 3 fields as arguments to the functions. The problem is that the function only accepts single values, I want to execute it for every record in my Qlik table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my table in Qlik :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | C&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;220.2&amp;nbsp; &amp;nbsp;| 250.0&amp;nbsp; | 250&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;250.6&amp;nbsp; &amp;nbsp;| 280.0 | 300&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;250.9&amp;nbsp; | 290.0&amp;nbsp; | 320&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to execute this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;ST_Transform(st_pointz("A","B","C",9895), 4937)&lt;/EM&gt; for every record and get the result in a table.&lt;/P&gt;
&lt;P&gt;So, i need to have in a new table, these results :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("220.2"&amp;nbsp; , "250.0" , "250", 9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("250.6"&amp;nbsp; &amp;nbsp;, "280.0" , "300", 9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ST_Transform(st_pointz("250.9" ,&amp;nbsp; "290.0"&amp;nbsp; , "320",9895), 4937)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I did &lt;STRONG&gt;one solution&lt;/STRONG&gt;, which consists of looping over the table and getting the "i" value, send the request to postgres and get the data in a table, then increment the i and do the same thing with the next line... It does the job, but when in production I will have thousands or millions of record data, it is going to be so heavy and it will have a negative impact on the performance !&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So please, can you help me with a few hints ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 12:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Use-Qlik-Sense-fields-to-send-SQL-query-to-Postgres-server/m-p/2007564#M83369</guid>
      <dc:creator>mab_koz</dc:creator>
      <dc:date>2022-11-22T12:45:48Z</dc:date>
    </item>
  </channel>
</rss>

