<?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 If and Above function - Not getting all records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426548#M158926</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;In the table below I have sorted on "CustAccount" then "Purchase date" and finally "Bought Package". I'm aiming at exporting a list to Excel, which will show me the latest purchase of a customer and if he has bought a "package". My idea was then to create a calculated with an IF function so I quickly could delete unwanted lines in Excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used this function to create the calculated field "Delete Row":&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(1))=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(1), 'Yes', 'No') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG __jive_id="33423" class="jive-image-thumbnail jive-image" onclick="" alt="Capture.PNG" src="https://community.qlik.com/legacyfs/online/33423_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;But it is not working the way I wanted. If that were the case, there would be a "yes" at the second 10000066 customer and several others. It seems to me that if the purchase date is different then my function fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on what I'm doing wrong &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>Mon, 11 Feb 2013 23:35:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-02-11T23:35:39Z</dc:date>
    <item>
      <title>If and Above function - Not getting all records</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426548#M158926</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;In the table below I have sorted on "CustAccount" then "Purchase date" and finally "Bought Package". I'm aiming at exporting a list to Excel, which will show me the latest purchase of a customer and if he has bought a "package". My idea was then to create a calculated with an IF function so I quickly could delete unwanted lines in Excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used this function to create the calculated field "Delete Row":&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;if &lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Above&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(1))=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Column&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(1), 'Yes', 'No') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG __jive_id="33423" class="jive-image-thumbnail jive-image" onclick="" alt="Capture.PNG" src="https://community.qlik.com/legacyfs/online/33423_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;But it is not working the way I wanted. If that were the case, there would be a "yes" at the second 10000066 customer and several others. It seems to me that if the purchase date is different then my function fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on what I'm doing wrong &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>Mon, 11 Feb 2013 23:35:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426548#M158926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-11T23:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: If and Above function - Not getting all records</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426549#M158927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not 100% sure what you are looking for, maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(CUSTACCOUNT = above(CUSTACCOUNT),'Yes','No')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or try creating a chart with only dimension CUSTACCOUNT, and use an expression with FirstSortedValue() function to return the value for Bought Package for the latest purchase date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=FirstSortedValue([Bought Package], -[Purchase Date])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[this requires that you only got one Bought Package status per unique purchase date].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 00:10:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426549#M158927</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-02-12T00:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: If and Above function - Not getting all records</title>
      <link>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426550#M158928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Column(1) would be your PurchaseDate column, assuming it's the first expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, instead of exporting this table with such a 'flag' so you must then manually delete, why not just construct the chart/table so that you export just one row per customer, with latest purcahse date and a flag whether that customer ever bought a package.&amp;nbsp; Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="33426" alt="Capture.PNG" class="jive-image" src="https://community.qlik.com/legacyfs/online/33426_Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Code is something like this (see attached QVW):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13606299270431967" jivemacro_uid="_13606299270431967"&gt;&lt;P&gt;Fact:&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(BoughtPackage='No',Dual('No',0),Dual('Yes',1)) As BoughtPackageFlag;&lt;/P&gt;&lt;P&gt;LOAD CustomerAcct, &lt;/P&gt;&lt;P&gt;&amp;nbsp; date(floor(PurchaseDate)) As PurchaseDate, &lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(IsNull(BoughtPackage),'No',BoughtPackage) As BoughtPackage&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;LatestPurchase.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 00:12:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-and-Above-function-Not-getting-all-records/m-p/426550#M158928</guid>
      <dc:creator />
      <dc:date>2013-02-12T00:12:02Z</dc:date>
    </item>
  </channel>
</rss>

