<?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: Expression -1 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258857#M397391</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share some sample data with expected output from that data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Mar 2017 10:16:44 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-03-09T10:16:44Z</dc:date>
    <item>
      <title>Expression -1</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258856#M397390</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;I have a table in excel that shows Name and another table that shows Name, Rank, Value. What I need to do is create a table in QV that shows Name, Rank, Value, Rank -1 (so if I'm rank 3, I need Rank 2), the Value and Name for that rank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Value I think I need something like =if(Rank-1=Rank, Value)&lt;/P&gt;&lt;P&gt;For Name I think I need something like =if(Rank-1=Rank, Name) but I'm having no joy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 10:13:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258856#M397390</guid>
      <dc:creator>kevbrown</dc:creator>
      <dc:date>2017-03-09T10:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Expression -1</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258857#M397391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share some sample data with expected output from that data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 10:16:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258857#M397391</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-09T10:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Expression -1</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258858#M397392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, for one thing whenever the expression engine evaluates a comparison like "Rank -1 = Rank" it will always return false as there is no value for which this comparison returns true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that - given the nature of the associative model - it will be very difficult to make this work on the fly. You can easily create a correct table in your LOAD script. The best way to get an example is to follow Sunny's advice and post some source data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 11:15:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258858#M397392</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-03-09T11:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Expression -1</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258859#M397393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, context is important...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may be wrong, but maybe it's enough to create a straight table chart with dimension Name and as expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only(Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Only(Rank)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort your table by Rank expression ascending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use &lt;EM&gt;chart inter record functions l&lt;/EM&gt;ike Above() to address the values in the line above the current:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Above( Only(Value) )&lt;/P&gt;&lt;P&gt;=Above( Only(Name) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar could be achieved in the script using &lt;EM&gt;inter record functions&lt;/EM&gt; Previous() or Peek() in a sorted table load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 11:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-1/m-p/1258859#M397393</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-09T11:53:14Z</dc:date>
    </item>
  </channel>
</rss>

