<?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 how to add a filter for a integer column with date value as 20220132 in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126180#M7582</link>
    <description>&lt;P&gt;I have column value (represents date) "20220132" added as integer in a sql table. I need to filter that data in QLIK replicate but need a portion of data in the filter clause.... currently I am using substr. but is there a better way to do it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filter the data for left(columnvalue) = 2023&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2023 17:04:09 GMT</pubDate>
    <dc:creator>jyeragi</dc:creator>
    <dc:date>2023-10-06T17:04:09Z</dc:date>
    <item>
      <title>how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126180#M7582</link>
      <description>&lt;P&gt;I have column value (represents date) "20220132" added as integer in a sql table. I need to filter that data in QLIK replicate but need a portion of data in the filter clause.... currently I am using substr. but is there a better way to do it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Filter the data for left(columnvalue) = 2023&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 17:04:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126180#M7582</guid>
      <dc:creator>jyeragi</dc:creator>
      <dc:date>2023-10-06T17:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126225#M7584</link>
      <description>&lt;P&gt;Substring is fine if you just need to filter by year, but then you should compare against '2023' - quoted! Test.&lt;/P&gt;
&lt;P&gt;Personally&lt;SPAN&gt;&amp;nbsp; I would used $DateAsInt/10000 == 2023 as integer source divides in Replicate remain INTEGER.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Now if you also need to validate the string to exclude invalid dates like you presented (accidently) in your example "&lt;SPAN&gt;20220132", or if you need to convert to&amp;nbsp; a proper date (highly recommended!) then you need to take it further apart as strings or with DIV and MOD operations as there is no format specifier for string to dat conversions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Mind you, the documentation for MOD and DIV in the Replicate User Guide is weak.&amp;nbsp; There is a typo in MOD (%SALARY/7) should read (SALARY%7 or rather: $SALARY % 7). And the bit about decimal points for DIV is incomprehensive. You best bet is to run a few interactive test with the Expression Builder PARSE - TEST.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have fun,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hein.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 21:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126225#M7584</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-10-06T21:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126255#M7587</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164264"&gt;@jyeragi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Besides&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110970"&gt;@Heinvandenheuvel&lt;/a&gt;&amp;nbsp;'s comment, I'd like to use&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;$DateAsInt &amp;gt; 20230000&lt;/FONT&gt; straightly, without implicit/explicit data type conversations, and no additional computing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 08:43:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2126255#M7587</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-10-07T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131531#M7837</link>
      <description>&lt;P&gt;for the following script&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Filter the data for left(columnvalue) = 2023&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can we fetch the right side values (e.g: 2023) as max from a table name?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am trying to fetch max of date&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;tsql query : Select max(snapshot_month_dt) from dateList table.... where&amp;nbsp;snapshot_month_dt being int column which stores values like&amp;nbsp;20230930,&amp;nbsp;20230831&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 22:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131531#M7837</guid>
      <dc:creator>jyeragi</dc:creator>
      <dc:date>2023-10-24T22:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131548#M7842</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164264"&gt;@jyeragi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If the data type is INT then I think&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/110970"&gt;@Heinvandenheuvel&lt;/a&gt;&amp;nbsp;provided a good way:&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;Personally&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; I would used &lt;FONT face="courier new,courier"&gt;$DateAsInt/10000 == 2023&lt;/FONT&gt; as integer source divides in Replicate remain INTEGER.&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the data type is STRING then &lt;A title="substr()" href="https://help.qlik.com/en-US/replicate/May2023/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_expressOther.htm#Strings:~:text=substr(x%2Cy,refer%20to%20bytes." target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;substr()&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;can be used.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;John.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 01:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131548#M7842</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2023-10-25T01:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131553#M7843</link>
      <description>&lt;P&gt;Thanks John.... I have verified and&amp;nbsp;&lt;SPAN&gt;$DateAsInt/10000 = 2023 works fine....The issue is now, I need to replace that value with value from database table by getting the max value....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;snapshot_month_dt &amp;gt;= max(snapshot_month_dt)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can I adjust the following tsql queries in&amp;nbsp;Fullload Passthru Filter format?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Select max(snapshot_month_dt) from dbo.DateList&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;OR&lt;BR /&gt;Select top 1 snapshot_month_dt from dbo.DateList where snapshot_month_dt in (select distinct max(snapshot_month_dt) from dbo.DateList)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where&amp;nbsp;snapshot_month_dt is in&amp;nbsp;20230930 format&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 01:56:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131553#M7843</guid>
      <dc:creator>jyeragi</dc:creator>
      <dc:date>2023-10-25T01:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131953#M7854</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/115309"&gt;@john_wang&lt;/a&gt;&amp;nbsp;&amp;nbsp;- Do you have any examples on the above query/problem?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 23:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2131953#M7854</guid>
      <dc:creator>jyeragi</dc:creator>
      <dc:date>2023-10-25T23:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a filter for a integer column with date value as 20220132</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2132295#M7864</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164264"&gt;@jyeragi&lt;/a&gt;&amp;nbsp; - "&lt;SPAN&gt;need to replace that value with value from database table by getting the max value"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Well, when using that for CDC you will need to use SOURCE_LOOKUP. Here is my (working, tested, silly) example. In this contrived example I just want to take the last 3 rows based on an ever increasing ID field. The filter expression I used for that was:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;$ID &amp;gt; source_lookup(999,'ATT_USER','TEST','MAX(ID)','1=1') - 3&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You could try &lt;STRONG&gt;$&lt;SPAN&gt;snapshot_month_dt&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;gt;= source_lookup(999,'your_schema','your_table','MAX(&lt;SPAN&gt;snapshot_month_dt&amp;nbsp;&lt;/SPAN&gt;)','1=1')&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For pass-thru fullload filter you need to use a SOURCE-DB NATIVE select clause.&amp;nbsp; Look for other articles on guidance how to do so.&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 21:46:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/how-to-add-a-filter-for-a-integer-column-with-date-value-as/m-p/2132295#M7864</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2023-10-26T21:46:14Z</dc:date>
    </item>
  </channel>
</rss>

