<?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 Issue on a SQL Function in SCRIPT QVD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issue-on-a-SQL-Function-in-SCRIPT-QVD/m-p/238447#M89312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a problem in the SQL server sorry &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 May 2010 11:06:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-05-12T11:06:01Z</dc:date>
    <item>
      <title>Issue on a SQL Function in SCRIPT QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-on-a-SQL-Function-in-SCRIPT-QVD/m-p/238446#M89311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a request in SQL to create a QVD.&lt;/P&gt;&lt;P&gt;In SQL server this request works fine but in QLikview I Have a error :&lt;/P&gt;&lt;P&gt;This is the request:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;LOAD&lt;BR /&gt; '$(BusinessName)' as "Business name",&lt;BR /&gt; "admin_id" as "Admin id",&lt;BR /&gt; dayname(date) as "History date",&lt;BR /&gt; libelle as "Segment Lib",&lt;BR /&gt; /*num(Hour(date)) as "History Hour",&lt;BR /&gt; num(minute(date)) as "History Minute",&lt;BR /&gt; num(second(date)) as "History Second",*/&lt;BR /&gt; refid,&lt;BR /&gt; users_file_id,&lt;BR /&gt; Tp;&lt;BR /&gt;SQL&lt;BR /&gt;SELECT SEGMENT.libelle,"admin_id",date,refid,users_file_id,Tp&lt;BR /&gt;FROM (SELECT h.id,&lt;BR /&gt; "admin_id",&lt;BR /&gt; date,&lt;BR /&gt; refid,&lt;BR /&gt; lastvalue,&lt;BR /&gt; newvalue,&lt;BR /&gt; u.user_id as users_file_id,&lt;BR /&gt; case when lastvalue = '9' and newvalue = '2' then 1&lt;BR /&gt; when lastvalue = '2' and newvalue = '9' then 2&lt;BR /&gt; when lastvalue = '0' and newvalue = '2' then 3&lt;BR /&gt; END as Tp&lt;BR /&gt;FROM [$(DBName)].[$(DBOwner)].history h&lt;BR /&gt;INNER JOIN [$(DBName)].[$(DBOwner)].users_file u ON refid = u.id&lt;BR /&gt;where date &amp;gt;= convert(datetime,'$(startdate)',103) and date &amp;lt; convert(datetime,'$(enddate)',103)&lt;BR /&gt;AND [table] = 'users_file'&lt;BR /&gt;AND [column] = 'statut'&lt;BR /&gt;AND (([lastvalue]='9' and [newvalue] = '2')&lt;BR /&gt; OR ([lastvalue]='2' and [newvalue] = '9')&lt;BR /&gt; OR ([lastvalue]='0' and [newvalue] = '2'))) as t&lt;BR /&gt;INNER JOIN [$(DBName)].[$(DBOwner)].users_file WITH(NOLOCK) ON t.refid = users_file.id&lt;BR /&gt; INNER JOIN [$(DBName)].[$(DBOwner)].users WITH(NOLOCK) ON users_file.user_id = users.id&lt;BR /&gt; INNER JOIN [$(DBName)].[$(DBOwner)].[site] WITH(NOLOCK) ON users.site_code = site.code&lt;BR /&gt; INNER JOIN [$(DBName)].[$(DBOwner)].[admin] WITH(NOLOCK) ON t.admin_id = admin.id&lt;BR /&gt; LEFT OUTER JOIN (SELECT code, libelle FROM dbo.segment_list(0, 0, DEFAULT) AS segment_list_1) AS SEGMENT ON dbo.users.segment = SEGMENT.code;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;the error is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;SQL Error:[Microsoft][SQL Native Client][SQL Server]Procedure or function dbo.segment_list has too many arguments specified.&lt;BR /&gt;SQL Scriptline:&lt;BR /&gt;SQL State:37000&lt;BR /&gt;SQL&lt;BR /&gt;SELECT SEGMENT.libelle,"admin_id",date,refid,users_file_id,Tp&lt;BR /&gt;FROM (SELECT h.id,&lt;BR /&gt; "admin_id",&lt;BR /&gt; date,&lt;BR /&gt; refid,&lt;BR /&gt; lastvalue,&lt;BR /&gt; newvalue,&lt;BR /&gt; u.user_id as users_file_id,&lt;BR /&gt; case when lastvalue = '9' and newvalue = '2' then 1&lt;BR /&gt; when lastvalue = '2' and newvalue = '9' then 2&lt;BR /&gt; when lastvalue = '0' and newvalue = '2' then 3&lt;BR /&gt; END as Tp&lt;BR /&gt;FROM [Bruno].[dbo].history h&lt;BR /&gt;INNER JOIN [Bruno].[dbo].users_file u ON refid = u.id&lt;BR /&gt;where date &amp;gt;= convert(datetime,'01/01/2009',103) and date &amp;lt; convert(datetime,'01/02/2009',103)&lt;BR /&gt;AND [table] = 'users_file'&lt;BR /&gt;AND [column] = 'statut'&lt;BR /&gt;AND (([lastvalue]='9' and [newvalue] = '2')&lt;BR /&gt; OR ([lastvalue]='2' and [newvalue] = '9')&lt;BR /&gt; OR ([lastvalue]='0' and [newvalue] = '2'))) as t&lt;BR /&gt;INNER JOIN [betclick].[dbo].users_file WITH(NOLOCK) ON t.refid = users_file.id&lt;BR /&gt; INNER JOIN [Bruno].[dbo].users WITH(NOLOCK) ON users_file.user_id = users.id&lt;BR /&gt; INNER JOIN [Bruno].[dbo].[site] WITH(NOLOCK) ON users.site_code = site.code&lt;BR /&gt; INNER JOIN [Bruno].[dbo].[admin] WITH(NOLOCK) ON t.admin_id = admin.id&lt;BR /&gt; LEFT OUTER JOIN (SELECT code, libelle FROM dbo.segment_list(0, 0, DEFAULT) AS segment_list_1) AS SEGMENT ON dbo.users.segment = SEGMENT.code&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Can you help me to find the error please?&lt;/P&gt;&lt;P&gt;King regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 09:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-on-a-SQL-Function-in-SCRIPT-QVD/m-p/238446#M89311</guid>
      <dc:creator />
      <dc:date>2010-05-12T09:10:43Z</dc:date>
    </item>
    <item>
      <title>Issue on a SQL Function in SCRIPT QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Issue-on-a-SQL-Function-in-SCRIPT-QVD/m-p/238447#M89312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a problem in the SQL server sorry &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 11:06:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issue-on-a-SQL-Function-in-SCRIPT-QVD/m-p/238447#M89312</guid>
      <dc:creator />
      <dc:date>2010-05-12T11:06:01Z</dc:date>
    </item>
  </channel>
</rss>

