<?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: Concatenate fields in SQL Statement in QlikView in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488807#M101712</link>
    <description>&lt;P&gt;I tried it bbut the problem with this code is that for example, lets suppose i have in the qvd only the VBELN 1&amp;nbsp; with POSNR 10 and VBELN 2 with POSNR 30, and in sap i have VBELN 1 with POSNR 30, this code will not add it to my qvd because the VBELN 1 exists and the POSNR 30 exists. I need to compare the key entirely&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2024 17:59:50 GMT</pubDate>
    <dc:creator>NicolasRivas</dc:creator>
    <dc:date>2024-10-23T17:59:50Z</dc:date>
    <item>
      <title>Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488771#M101706</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have do a sql query to a sap table named VBUP, but i have to select filter the rows that doesn't already exists in a QVD I have stored of that same table. I am trying a lot of ways but I am not able to concatenate the fields in the sql statement to compare it to the values of the QVD. this is what I am trying now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;EXISTENTES:
FIRST 10 LOAD
	%KEY_VBUP_MANDT_POSNR_VBELN
FROM
[..\QVD\DATA_SAP_01_AR_400_VBUP.QVD]
(qvd);

EXISTENTES_SIN_CHAR:
NOCONCATENATE LOAD
	CONCAT(PURGECHAR(%KEY_VBUP_MANDT_POSNR_VBELN,'|'),',')	AS %KEY_VBUP_MANDT_POSNR_VBELN
//	PURGECHAR(%KEY_VBUP_MANDT_POSNR_VBELN,'|')				AS %KEY_VBUP_MANDT_POSNR_VBELN
RESIDENT EXISTENTES;
DROP TABLE EXISTENTES;

LET vFilterValues = PEEK('%KEY_VBUP_MANDT_POSNR_VBELN',0,'EXISTENTES_SIN_CHAR'); // You need to generate this list from QlikView


$(S_NmTabla) :   // Documento de ventas: Datos de cabecera
LOAD 
  MANDT, 
  POSNR,
  VBELN;
SQL Select
	MANDT 
	POSNR 
	VBELN
FROM VBUP
WHERE (MANDT || POSNR || VBELN) IN ($(vFilterValues))
;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I already tried with + or &amp;amp; or || or with concat(mandt,posnr,vbeln) but i always get some error,&lt;/P&gt;
&lt;P&gt;I have to fitler it in the sql because I dont want to retrieve ALL the rows so I can lower the execution time.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 16:34:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488771#M101706</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-11-16T16:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488797#M101707</link>
      <description>&lt;P&gt;Try below:&lt;/P&gt;
&lt;P&gt;// Load all tables and their fields dynamically&lt;BR /&gt;FOR i = 0 TO NoOfTables()-1&lt;/P&gt;
&lt;P&gt;LET vTable = TableName(i); // Get the name of the table&lt;/P&gt;
&lt;P&gt;FOR j = 1 TO NoOfFields(vTable) // Loop through each field in the table&lt;/P&gt;
&lt;P&gt;LET vField = FieldName(j, vTable); // Get the name of the field&lt;/P&gt;
&lt;P&gt;// Load each table name and field name into a new table&lt;BR /&gt;TableFieldInfo:&lt;BR /&gt;LOAD&lt;BR /&gt;'$(vTable)' as TableName,&lt;BR /&gt;'$(vField)' as FieldName&lt;BR /&gt;AUTOGENERATE 1;&lt;BR /&gt;// from Your_Table_name - this works if you have a specif table to work with, if working with this remove the outer for loop FOR i = 0 TO NoOfTables()-1&lt;/P&gt;
&lt;P&gt;NEXT j&lt;/P&gt;
&lt;P&gt;NEXT i&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;// Create a new table that will store concatenated values&lt;BR /&gt;ConcatenatedValuesTable:&lt;BR /&gt;LOAD &lt;BR /&gt;Concat(DISTINCT FieldName, ', ') as ConcatenatedFieldValues&lt;BR /&gt;RESIDENT TableFieldInfo;&lt;/P&gt;
&lt;P&gt;LET vFilterValues = PEEK('ConcatenatedFieldValues',0,'ConcatenatedValuesTable');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just note if you wanna compare fields from the SQL table and existing Qlik Table, my preferred method would be by using where not exist(), after i have fieldname info from both the tables.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 17:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488797#M101707</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2024-10-23T17:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488798#M101708</link>
      <description>&lt;P&gt;Hello Qrishna,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your quick response, But i don't think this is a solution here, because what I have to do is take the existing rows of the VBUP table that I have in the vbup.qvd and do a "where not exists(rowsin the qvd, rows in sql)" but i have to do it IN the SQL statement.&lt;/P&gt;
&lt;P&gt;I am having trouble concatenating the fields to make the key that I have to make to compare it with the key in the QVD.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 16:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488798#M101708</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-23T16:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488800#M101709</link>
      <description>&lt;P&gt;you mean here in in this pice of code:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;WHERE (MANDT || POSNR || VBELN) IN ($(vFilterValues))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;when&amp;nbsp; you said ''&amp;nbsp;&lt;SPAN&gt;but i have to select the fields that doesnt already exists in a QVD", thas what the above code is for.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I believe you are looking for incremental load logic, as you dont want to load all the rows that already exist in QLikl QVD, but load only non existing rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try below:&lt;/P&gt;
&lt;DIV&gt;EXISTENTES:&lt;/DIV&gt;
&lt;DIV&gt;FIRST 10 LOAD&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; KEY_VBUP_MANDT_POSNR_VBELN&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;FROM&lt;/DIV&gt;
&lt;DIV&gt;[..\QVD\DATA_SAP_01_AR_400_VBUP.QVD]&lt;/DIV&gt;
&lt;DIV&gt;(qvd);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;// Store unique field values into variables to use in SQL WHERE clause&lt;/DIV&gt;
&lt;DIV&gt;LET vKEY_VBUP = Concat(DISTINCT chr(39) &amp;amp; KEY_VBUP_MANDT_POSNR_VBELN &amp;amp; chr(39), ', ');&amp;nbsp; // Concatenate ID values with quotes&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;// Load SQL table with a WHERE clause that excludes the KEY_VBUP_MANDT_POSNR_VBELN already present in QlikTable&lt;/DIV&gt;
&lt;DIV&gt;SQLTable:&lt;/DIV&gt;
&lt;DIV&gt;SQL SELECT&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MANDT&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;POSNR&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VBELN&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;FROM YourSQLTable&lt;/DIV&gt;
&lt;DIV&gt;WHERE &lt;SPAN&gt;MANDT&amp;nbsp;&lt;/SPAN&gt;NOT IN ($(vKEY_VBUP))&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (AND/OR) &lt;SPAN&gt;POSNR&amp;nbsp;&lt;/SPAN&gt;NOT IN ($(vKEY_VBUP)) ....&lt;/DIV&gt;
&lt;DIV&gt;;&amp;nbsp; // Exclude rows with $(vKEY_VBUP) already in QlikTablele&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Oct 2024 17:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488800#M101709</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2024-10-23T17:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488801#M101710</link>
      <description>&lt;P&gt;exactly, i am doing there&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;MANDT || POSNR || VBELN&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;jn an attempt to concatenate the ifled to makye the key I want to compare. But that throws me the error&amp;nbsp; '"|" is not a valid comparison operator'&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 17:14:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488801#M101710</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-23T17:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488807#M101712</link>
      <description>&lt;P&gt;I tried it bbut the problem with this code is that for example, lets suppose i have in the qvd only the VBELN 1&amp;nbsp; with POSNR 10 and VBELN 2 with POSNR 30, and in sap i have VBELN 1 with POSNR 30, this code will not add it to my qvd because the VBELN 1 exists and the POSNR 30 exists. I need to compare the key entirely&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 17:59:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488807#M101712</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-23T17:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488812#M101715</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp; I doubt that concat() function will work for SAP but give it a try.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WHERE concat(MANDT ,'|',POSNR,'|', VBELN) IN ($(vFilterValues))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If concatenation of fields is not possible in where clause of SAP you can perform inner join between QVD &amp;amp; SAP table;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 18:24:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488812#M101715</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-10-23T18:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488813#M101716</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;, I tried it but it doesn't work, and the thing about the inner join, is that in order to do that, i have to retrieve all rows rom SAP table i dont want to retrieve all of them to lower the excution time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 18:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488813#M101716</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-23T18:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488818#M101720</link>
      <description>&lt;P&gt;im not really sure if you could use&amp;nbsp;concatenation with &lt;CODE&gt;||&lt;/CODE&gt;&amp;nbsp; to create a composite condition in the &lt;CODE&gt;IN&lt;/CODE&gt; clause like that as its a logical operator.&amp;nbsp; we usually do soemthing like below:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hljs-keyword"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;NOT&lt;/SPAN&gt; (&lt;SPAN&gt;MANDT&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;($(vKEY_VBUP))&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;OR&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;POSNR&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;($(vKEY_VBUP))&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;OR&lt;/SPAN&gt; &lt;SPAN&gt;VBELN&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt; &lt;SPAN&gt;($(vKEY_VBUP))&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hljs-keyword"&gt;WHERE&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;NOT&lt;/SPAN&gt; (MANDT &lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt; ($(vKEY_VBUP)) &lt;SPAN class="hljs-operator"&gt;||&lt;/SPAN&gt; POSNR &lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt; ($(vKEY_VBUP)) &lt;SPAN class="hljs-operator"&gt;||&lt;/SPAN&gt; VBELN &lt;SPAN class="hljs-keyword"&gt;IN&lt;/SPAN&gt; ($(vKEY_VBUP)))&lt;/P&gt;
&lt;P&gt;you can give atry to this too:&lt;/P&gt;
&lt;P&gt;WHERE MANDT NOT IN (SELECT MANDT FROM QlikTable) AND POSNR NOT IN (SELECT POSNR FROM QlikTable)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 19:10:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488818#M101720</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2024-10-23T19:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488824#M101722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SQL statement can not see anything within your Qlik script or data model, as it is executed on the SAP server.&lt;/P&gt;
&lt;P&gt;The only way you will be able to achieve this is to craft the SQL server by concatenating strings into a variable.&lt;/P&gt;
&lt;P&gt;You are very much headed in the right direction with your code, but you need to ensure what you come out with at the end is a valid SQL statement.&lt;/P&gt;
&lt;P&gt;To ensure that the&amp;nbsp;vFilterValues variable contains what you think it does add this line after you set the variable:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;TRACE $(vFilterValues);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It looks to me like you will get a comma separated set of values, without quotes. Is that what you are after?&lt;/P&gt;
&lt;P&gt;I think the concat probably wants to be:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CONCAT(chr(39) &amp;amp; PURGECHAR(%KEY_VBUP_MANDT_POSNR_VBELN,'|') &amp;amp; chr(39),',')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This will add a single quote around each value.&lt;/P&gt;
&lt;P&gt;That variable will be inserted into your code exactly as it appears in the trace. You can therefore work out what SQL statement you are sending to the server.&lt;/P&gt;
&lt;P&gt;It seems to me that the issue is with the SQL code, so you could try just running the SQL in the query analyser in your database - this will be quicker to debug.&lt;/P&gt;
&lt;P&gt;All SQL variants differ a little, so Google how to do a string concatenate in the one you are using (+ is quite common).&lt;/P&gt;
&lt;P&gt;Once you have the concatenation syntax, I think you probably want a SQL statement similar to this, to exclude values rather than include them:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;WHERE MANDT + POSNR + VBELN NOT IN ($(vFilterValues))&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;But, as I say it will depend on your flavour of SQL.&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 19:28:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488824#M101722</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2024-10-23T19:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488825#M101723</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp; If concatenation field doesn't support in SAP query of where clause, you may need to look for other alternatives. One option is you could try below sub query&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SQL Select a.* from 
(
Select MANDT,
       POSNR,
       VBELN,
       MANDT || POSNR || VBELN as KEY
FROM VBUP) AS a
where a.KEY in ($(vFilterValues))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 19:29:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488825#M101723</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-10-23T19:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488956#M101736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just realised, following up on my post yesterday. Unless the QVD you are checking for existing values against has each combination of values only once, you will want to add a DISTINCT to the CONCAT statement or you could have a massive list of values:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CONCAT(DISTINCT chr(39) &amp;amp; PURGECHAR(%KEY_VBUP_MANDT_POSNR_VBELN,'|') &amp;amp; chr(39),',')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 12:58:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488956#M101736</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2024-10-24T12:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488978#M101740</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for you advice!&lt;/P&gt;
&lt;P&gt;I tried it but it doesn't work either, its showing me this error&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasRivas_0-1729777672539.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173378i9F6EC569CC8B216B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NicolasRivas_0-1729777672539.png" alt="NicolasRivas_0-1729777672539.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I trie laso with concat(), with subselect, wit posnr and vbeln instead of a.*, but its always showing me that error&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 13:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488978#M101740</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-24T13:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488982#M101741</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6748"&gt;@stevedark&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first of all thank you for your advice,&lt;/P&gt;
&lt;P&gt;I think the filter variable is okay because I am seeing the data in the correct format in the debug, as you can see here&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasRivas_0-1729777960417.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173379iDC2AF7A32599A8DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NicolasRivas_0-1729777960417.png" alt="NicolasRivas_0-1729777960417.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;WHERE MANDT + POSNR + VBELN NOT IN ($(vFilterValues))&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Also I tried this, also tried, posnr || vbeln, concat(posnr,vbeln),&amp;nbsp;posnr &amp;amp; vbeln,&amp;nbsp;posnr &amp;amp; vbeln, but nothing works, its always showing me this error&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NicolasRivas_1-1729778169538.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/173381iC087360E2A71035C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NicolasRivas_1-1729778169538.png" alt="NicolasRivas_1-1729778169538.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 13:56:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488982#M101741</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-24T13:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488984#M101742</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue here is that different flavours of SQL have different syntax. The syntax&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;has given for a subquery looks spot on, but it may not work with the particular SQL you are using.&lt;/P&gt;
&lt;P&gt;Try building up the statement, without using variables, in a separate app to find where it breaks.&lt;/P&gt;
&lt;P&gt;For instance, try it first without the WHERE statement, to see if the problem is there.&lt;/P&gt;
&lt;P&gt;If the concatenation code is correct I don't see any reason why it would work in a subquery but not in the WHERE statement though.&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:00:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488984#M101742</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2024-10-24T14:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488986#M101743</link>
      <description>&lt;P&gt;I think the first issue you need to crack is simply one of string concatenation. Try testing without any where statement or anything else, just a simple:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SQL Select
	POSNR || VBELN as KEY
FROM VBUP&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Until that is working nothing else matters.&lt;/P&gt;
&lt;P&gt;I see from one of the table names that SAP is involved. In which case it seems || is correct, but suggest also trying double ampersand &amp;amp;&amp;amp; in their place.&lt;/P&gt;
&lt;P&gt;Doing this in the SQL query analyser, not in Qlik at all, may make it quicker to find the solution.&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:07:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488986#M101743</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2024-10-24T14:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488995#M101744</link>
      <description>&lt;P&gt;Yes, I already tried doing a simple query like the one you are mentioning but it doesnt work either, the same error is showing.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:39:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488995#M101744</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-24T14:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488997#M101745</link>
      <description>&lt;P&gt;Do you know what type of database it is you are loading from? Without getting the simple concatenate in a load statement working there is no way of getting the rest to work.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488997#M101745</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2024-10-24T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488999#M101746</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/113950"&gt;@NicolasRivas&lt;/a&gt;&amp;nbsp; It seems this type of sub query is not supported in SAP. You could try with CTE&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;SQL 
WITH VBUPTemp
  AS ( SELECT POSNR,
              VBELN,
	      POSNR || VBELN as KEY 
       FROM VBUP 
      )
SELECT POSNR,VBELN,KEY
FROM VBUPTemp
where KEY in ($(vFilterValues))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Oct 2024 14:51:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2488999#M101746</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-10-24T14:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate fields in SQL Statement in QlikView</title>
      <link>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2490147#M101899</link>
      <description>&lt;P&gt;Thank you all for your advices,&lt;/P&gt;
&lt;P&gt;I change the logic to use another sap table so I could fitler by a single field, and that did it.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2024 13:22:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Concatenate-fields-in-SQL-Statement-in-QlikView/m-p/2490147#M101899</guid>
      <dc:creator>NicolasRivas</dc:creator>
      <dc:date>2024-10-31T13:22:09Z</dc:date>
    </item>
  </channel>
</rss>

