<?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: Max in IF statement in load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74278#M782341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Temp:&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: 12px; background-color: #f2f2f2;"&gt;Load Date(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;CEMinDt-5) as MaxDate;&lt;/SPAN&gt;&lt;BR /&gt;&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: 12px; background-color: #f2f2f2;"&gt;SQL SELECT Max(ReportDate) as CEMinDt&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: 12px; background-color: #f2f2f2;"&gt;FROM CSSC_Sequence_SIT.dbo.rptCE_ORMaster;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Mar 2018 16:39:14 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2018-03-22T16:39:14Z</dc:date>
    <item>
      <title>Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74273#M782335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to put the below calculation into my load so I can then use this flag in set analysis. Can this not be done? I keep receiving errors. I didn't think I would need a group by since Max is within the IF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(ReportDate&amp;gt;=Max(ReportDate)-5,1,0) as CADateFlag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74273#M782335</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74274#M782336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;in a load you're working at row level&lt;/P&gt;&lt;P&gt;you should calculate the max valeur first in one load&lt;/P&gt;&lt;P&gt;and use the value in the 2nd one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:53:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74274#M782336</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-03-22T15:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74275#M782337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to do something like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;Load Date(Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;ReportDate)-5) as MaxDate Resident YourTableName;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate');&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use&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;If(ReportDate&amp;gt;='$(vMaxDate)',1,0) as CADateFlag&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 15:53:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74275#M782337</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2018-03-22T15:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74276#M782338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is assigning 1 to all report dates. Any idea why? I followed your instructions and it seems like it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt;SQL SELECT Max(ReportDate)-5 CEMinDt&lt;BR /&gt;FROM CSSC_Sequence_SIT.dbo.rptCE_ORMaster;&lt;BR /&gt;LET vCEMinDt = Peek('CEMinDt');&lt;BR /&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;Load *,&lt;BR /&gt;IF(ReportDate&amp;gt;='$(vCEMinDt)',1,0) as CEDateFlag&lt;BR /&gt;;&lt;BR /&gt;Table1:&lt;BR /&gt;SQL SELECT ReportDate,&lt;BR /&gt; BackLog CEBacklog,&lt;BR /&gt; MultiNational CEMultinational,&lt;BR /&gt; CreditDebit CECreditDebit,&lt;BR /&gt; CE_EfftAge_Days,&lt;BR /&gt; CE_BillAge_Days,&lt;BR /&gt; CE_DueAge_Days,&lt;BR /&gt; CE_YTDTotalAmt,&lt;BR /&gt; OR_90PlusDayYTDAmt,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OR_EfftAge_0_30Amt,&lt;BR /&gt; OR_EfftAge_31_60Amt,&lt;BR /&gt; OR_EfftAge_61_90Amt,&lt;BR /&gt; OR_EfftAge_91Amt,&lt;BR /&gt; OR_EfftAge_0_30Cnt,&lt;BR /&gt; OR_EfftAge_31_60Cnt,&lt;BR /&gt; OR_EfftAge_61_90Cnt,&lt;BR /&gt; OR_EfftAge_91Cnt&lt;BR /&gt;FROM CSSC_Sequence_SIT.dbo.rptCE_ORMaster;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:36:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74276#M782338</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-03-22T16:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74277#M782339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Max(ReportDate) --&amp;gt; This will give you a integer.&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;&lt;BR /&gt;&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;Better to store value in some variable as suggested by Manish and then use it further.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:37:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74277#M782339</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2018-03-22T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74278#M782341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Temp:&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: 12px; background-color: #f2f2f2;"&gt;Load Date(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;CEMinDt-5) as MaxDate;&lt;/SPAN&gt;&lt;BR /&gt;&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: 12px; background-color: #f2f2f2;"&gt;SQL SELECT Max(ReportDate) as CEMinDt&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: 12px; background-color: #f2f2f2;"&gt;FROM CSSC_Sequence_SIT.dbo.rptCE_ORMaster;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:39:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74278#M782341</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2018-03-22T16:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74279#M782343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the format of the dates between tour database and Qlik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:39:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74279#M782343</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-03-22T16:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74280#M782346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked the temp table before I dropped it and it doesn't return an integer, it returns the date. It returns the correct date. I did store it in a variable as suggested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74280#M782346</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-03-22T16:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74281#M782347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put like this&lt;/P&gt;&lt;P&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;SQL SELECT &lt;STRONG&gt;Date(Max(ReportDate)-5)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74281#M782347</guid>
      <dc:creator>shiveshsingh</dc:creator>
      <dc:date>2018-03-22T16:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74282#M782349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;be careful that &lt;SPAN style="color: #3d3d3d; font-family: Helvetica;"&gt;'$(vMaxDate)'&lt;/SPAN&gt; returns a string and not a value in a date format&lt;/P&gt;&lt;P&gt;you should have to use date functions in QV or SQL to have two values of same type&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:44:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74282#M782349</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-03-22T16:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74283#M782351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In SQL it has to be formated like SQL SELECT CAST(Max(ReportDate)-5 as Date) but whether I do this or not I get the result in a date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/197200_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:46:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74283#M782351</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-03-22T16:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74284#M782352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting a date just like in the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/197205_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:46:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74284#M782352</guid>
      <dc:creator>greend21</dc:creator>
      <dc:date>2018-03-22T16:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Max in IF statement in load</title>
      <link>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74285#M782353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;date and time&lt;/P&gt;&lt;P&gt;can't this be the problem ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2018 16:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Max-in-IF-statement-in-load/m-p/74285#M782353</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-03-22T16:49:04Z</dc:date>
    </item>
  </channel>
</rss>

