<?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: Functions in sql query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094420#M363660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please let me know more about how to use SQL EXEC and CALL from Qlikvire script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahamed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2016 07:37:47 GMT</pubDate>
    <dc:creator>Mahamed_Qlik</dc:creator>
    <dc:date>2016-04-26T07:37:47Z</dc:date>
    <item>
      <title>Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094411#M363651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below given query hits my reload time by 3days..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT top 100 TWS_MIS.mis.ConvertCurrency(TWS_MIS.mis.TWS_ItinHotel.bookingid,TWS_MIS.mis.TWS_ItinHotel.rateamount,TWS_MIS.mis.TWS_ItinHotel.ratecurrency,'GBP',TWS_MIS.mis.TWS_Header.bkcreated) RATEAMOUNTGBP&lt;/P&gt;&lt;P&gt;,TWS_MIS.mis.TWS_ItinHotel.*&lt;/P&gt;&lt;P&gt;FROM TWS_MIS.mis.TWS_ItinHotel left join TWS_MIS.mis.TWS_Header &lt;/P&gt;&lt;P&gt;ON (TWS_MIS.mis.TWS_ItinHotel.BookingId=TWS_MIS.mis.TWS_Header.BookingId);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main thing in the query is I am calling the function "&lt;SPAN style="font-size: 13.3333px;"&gt;TWS_MIS.mis.ConvertCurrency&lt;/SPAN&gt;" which hips up the reload time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Query works proper in sql server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly advise for the best solution for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahamed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 10:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094411#M363651</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-25T10:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094412#M363652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hits my reload time by 3days ? where you are loading in qlik ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if yes then really this is very bad , you can create a cursor into sql load data into qv from cursor it may faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 11:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094412#M363652</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2016-04-25T11:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094413#M363653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One solution would be : To handle the ConvertCurrency logic in Qlik ..so that the reload time gets reduced and Qlikview had effective ways to handle the conversion scenario &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 11:33:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094413#M363653</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-04-25T11:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094414#M363654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tell me the one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 12:29:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094414#M363654</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-25T12:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094415#M363655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vikas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I running the query in initial load app with connectivity to sql.&lt;/P&gt;&lt;P&gt;And let me know how do we can create the cursor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 12:30:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094415#M363655</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-25T12:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094416#M363656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to build the currency conversion logic in Qlikview instead of handling the same in SQL query... so that SQL query will run properly &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 12:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094416#M363656</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-04-25T12:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094417#M363657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you do one thing&amp;nbsp; create logic of currency into qlikview as Avinash said&amp;nbsp; loading data into qv is always faster without any joins , Load 2 tables and create qvd . load this qvd into qvw and build logic of currency into qlikview itself&amp;nbsp; rather than apply logic in sql.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 05:21:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094417#M363657</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2016-04-26T05:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094418#M363658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you mean, It is always better to apply the logic in qlik than the sql query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahamed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 06:52:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094418#M363658</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-26T06:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094419#M363659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is weird. If you copy the exact same query from sql server (management studiio) into QlikView load script, it should work in exactly the same way. On condition that you use the same connection, machine, account, privileges and database. All surrounding factors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether you launch this query from a sql server tool or from QlikView load script, the SELECT (including any calls to stored procedures) is always passed on to and executed by the Database engine, not by QlikView or by the sql server tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, try to execute the CALL to the function straight from the QlikView load script using SQL EXEC and appropriate parameters. Do you get any results from a single call?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094419#M363659</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2016-04-26T07:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094420#M363660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please let me know more about how to use SQL EXEC and CALL from Qlikvire script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahamed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094420#M363660</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-26T07:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094421#M363661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahamed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of the time it seems that one can copy and paste SQL code from a SQL query tool and but it between &lt;/P&gt;&lt;P&gt;SQL and the semicolon in a load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is however at least one pitfall. QlikView is field oriented and not table oriented. That is the field has center-stage even though a field participates in one or more tables - it is the field that is the king. Relational databases on the other hand with SQL as the language being used to interface with them are table-oriented and the columns are merely peasants that belong to the table that is the king. Well they are more like serfs in this setting actually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;To be precise:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;QlikView needs each and every column coming from a SQL SELECT to be uniquely named&lt;/STRONG&gt;&lt;/EM&gt;. And it must be the column name alone that is unique. It is not sufficient that the combination of table and column name is unique within the SELECT. Sadly - QlikView doesn´t even give a very helpful error message when there are "duplicate" column names coming from the SELECT statement. I cant really imagine why QlikView doesnt just add a sequence number of some sort to duplicated column names when it needs to use that name as a field name getting it into memory... that would be a simple, elegant and smooth handling of this "issue" instead of breaking with a non-sensical error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way the results from a SELECT statement has no limitation whatsoever when it comes to column names. Because a SELECT statements results does not have the restrictions of a relational database table - even though it might look like a table it is not identical to a TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My advice to avoid such problems:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If you have a rather unclear SQL statement when it comes to column names - add an alias to each column by modifying your SQL. Then you make sure that each column has a unique column-name in the particular result set you try to load into QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a strong hunch that your problem is in the all inclusive &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;TWS_MIS.mis.TWS_ItinHotel.*.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;This probably brings in two columns with the same name. QlikView doesnt care if these are from two&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;different tables - so the semantics of QlikView IS different from a SQL database.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can rename the columns in SQL by using AS to give it a new name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Table1.ColumnA AS Table1_ColumnA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Table2.ColumnA AS Table2_ColumnA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094421#M363661</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-04-26T07:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Functions in sql query</title>
      <link>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094422#M363662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your helpful info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mahamed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 07:49:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Functions-in-sql-query/m-p/1094422#M363662</guid>
      <dc:creator>Mahamed_Qlik</dc:creator>
      <dc:date>2016-04-26T07:49:55Z</dc:date>
    </item>
  </channel>
</rss>

