<?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: CASE operator Missig in Replicate May 2023 in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105783#M7048</link>
    <description>&lt;P&gt;The return from source_lookup may be seen as a piece of string, which does not compare well against a number.&lt;/P&gt;
&lt;P&gt;By using "$a - $b"&amp;nbsp; a numeric conversion is forced.&lt;/P&gt;
&lt;P&gt;If you have the time and&amp;nbsp; interest please test:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;CASE WHEN&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp; &lt;FONT color="#00FF00"&gt;( 0 +&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;source_lookup('NO_CHACHING','dbo','CustomerHeader','AVG_Spent','CustomerID=?', $CustomerID)&lt;FONT color="#00FF00"&gt; )&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt; $ActualSpent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;THEN&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;'1'&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;ELSE&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;'0'&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;END&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This will force a conversion to numbers instead of text for the compare.&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Aug 2023 02:48:51 GMT</pubDate>
    <dc:creator>Heinvandenheuvel</dc:creator>
    <dc:date>2023-08-15T02:48:51Z</dc:date>
    <item>
      <title>CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105432#M7042</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;where can I find the &lt;EM&gt;&lt;STRONG&gt;CASE&lt;/STRONG&gt; &lt;/EM&gt;operation inside Qlik Replicate&amp;nbsp; on premises?&lt;/P&gt;
&lt;P&gt;The official help article states that it shoul exist, but in the operators list I cannot find it:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="philipp_kunz_1-1692003421685.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/114370iBC798D5955107D35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="philipp_kunz_1-1692003421685.png" alt="philipp_kunz_1-1692003421685.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Qlik Replicate (Windows):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="philipp_kunz_2-1692003525151.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/114371iB97D013B57663A98/image-size/medium?v=v2&amp;amp;px=400" role="button" title="philipp_kunz_2-1692003525151.png" alt="philipp_kunz_2-1692003525151.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;by manually typing it into the expression window, it allows me to execute the statement by starting the replication task, but it doesn't seem to execute it correctly...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;CASE WHEN&lt;/FONT&gt; source_lookup('NO_CHACHING','dbo','CustomerHeader','AVG_Spent','CustomerID=?', $CustomerID)&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt; $ActualSpent &lt;FONT color="#FF0000"&gt;THEN&lt;/FONT&gt; '1'&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;ELSE&lt;/FONT&gt; '0' &lt;FONT color="#FF0000"&gt;END&lt;/FONT&gt;&lt;/EM&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;can anyone help please?&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 10:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105432#M7042</guid>
      <dc:creator>philipp_ebner</dc:creator>
      <dc:date>2023-08-14T10:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105477#M7044</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17940"&gt;@philipp_ebner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Welcome to Qlik Community forum and thanks for reaching out here.&lt;/P&gt;
&lt;P&gt;Good insight. Looks to me the keywords&amp;nbsp;&lt;FONT face="courier new,courier"&gt;CASE WHEN&amp;nbsp;THEN&amp;nbsp;ELSE&amp;nbsp;END&lt;/FONT&gt; do not present in GUI editor in all Replicate versions. if you want to add them to GUI designer (and other SQLite supported operators) please raise a feature request in Qlik Community &lt;A title="Suggest Features" href="https://community.qlik.com/t5/Ideation/ct-p/qlik-product-insight#:~:text=Use%20the%20app,Suggest%20Features" target="_blank" rel="noopener"&gt;Suggest Features&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;When it comes to the expression, it's weird, please open a support ticket, our support team will trace the behavior further. As a workaround, let's modify it a bit to manage it to work (for example):&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;CASE WHEN source_lookup('NO_CHACHING','dbo','CustomerHeader','avg_spent','id=?', $id)-$actual_spent&amp;lt;=0 THEN '1' ELSE '0' END&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 10:32:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105477#M7044</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-08-14T10:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105571#M7046</link>
      <description>&lt;P&gt;I suspect the CASE are written is fine, but the SOURCE_LOOKUP is not. Try the CASE with a simple test 'case' for example 100 &amp;lt; $actual_spend.&lt;/P&gt;
&lt;P&gt;What is your Source Endpoint? The way you indicate the bind variables in the CONDition clause (record selection expression) varies by source database.&lt;/P&gt;
&lt;P&gt;Replicate User Guide:&amp;nbsp; "&lt;STRONG&gt;4. Select the source_lookup function and configure it as follows (using the native syntax of the source endpoint):&lt;/STRONG&gt; "&lt;/P&gt;
&lt;P&gt;For Oracle, instead of that question mark (SQL server), try a colon with a number reflecting the argument to provide: "ID = :1"&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 13:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105571#M7046</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-08-14T13:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105575#M7047</link>
      <description>&lt;P&gt;Hi John, thanks for your suggested workaround. This seems to be working fine.&lt;/P&gt;
&lt;P&gt;Nevertheless I will open a support Ticket to further investigate my errorenous syntax (SQL Server Endpoint).&lt;/P&gt;
&lt;P&gt;I guess this can easily be reproduced. Thank you anyway!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 13:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105575#M7047</guid>
      <dc:creator>philipp_ebner</dc:creator>
      <dc:date>2023-08-14T13:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105783#M7048</link>
      <description>&lt;P&gt;The return from source_lookup may be seen as a piece of string, which does not compare well against a number.&lt;/P&gt;
&lt;P&gt;By using "$a - $b"&amp;nbsp; a numeric conversion is forced.&lt;/P&gt;
&lt;P&gt;If you have the time and&amp;nbsp; interest please test:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;CASE WHEN&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp; &lt;FONT color="#00FF00"&gt;( 0 +&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;source_lookup('NO_CHACHING','dbo','CustomerHeader','AVG_Spent','CustomerID=?', $CustomerID)&lt;FONT color="#00FF00"&gt; )&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt; $ActualSpent&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;THEN&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;'1'&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;ELSE&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;'0'&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;END&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This will force a conversion to numbers instead of text for the compare.&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 02:48:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105783#M7048</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-08-15T02:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105892#M7052</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110970"&gt;@Heinvandenheuvel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Definitely you are right, I cannot agree you more :). We have to do data type &lt;SPAN&gt;conversion&amp;nbsp;&lt;/SPAN&gt;explicitly (as you do), or implicitly (my expression).&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 10:02:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2105892#M7052</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-08-15T10:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: CASE operator Missig in Replicate May 2023</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2106261#M7063</link>
      <description>&lt;P&gt;Hello Hein,&lt;/P&gt;
&lt;P&gt;thank you for your input. Your solution seems elegant and works brillantly fine! Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 11:26:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/CASE-operator-Missig-in-Replicate-May-2023/m-p/2106261#M7063</guid>
      <dc:creator>philipp_ebner</dc:creator>
      <dc:date>2023-08-16T11:26:10Z</dc:date>
    </item>
  </channel>
</rss>

