<?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: Above() Function On Different Dimension (for chart showing % change since last data point) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Above-Function-On-Different-Dimension-for-chart-showing-change/m-p/798609#M282002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked around some more on the site and it looks like others are trying to find the same solution that I am.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I looked harder at this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realized that I could calculate how many rows to climb up the chart to get to the prior week's value for the current user device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three factors in the solution I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first is a variable that contains the currently selected field in the cycle group on the chart.&amp;nbsp; (The cycle group part of the problem was not mentioned by me in the initial post.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vstrCurrentField =GetCurrentField([Platforms])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next sets a variable to the number of these items in the currently selected data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vintCountLoginPlatforms =count({&amp;lt;RecordType={'Login'}&amp;gt;} DISTINCT [$(vstrCurrentField)])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three important points here:&lt;/P&gt;&lt;P&gt;1. You need to have the fieldname from the cycle group in a variable. DISTINCT [GetCurrentField(Platforms)] would not work.&amp;nbsp; QV does not know to evaluate the function in that location.&amp;nbsp; There is a more general issue as well, that GetCurrentField(Platforms) returns a text value.&amp;nbsp; I have had situations where I needed this value treated as a field. If you put the result of GetCurrentField() into a variable and then use the variable, QV recognizes it now as a fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. You need to have the number of platforms in a variable.&amp;nbsp; You cannot put this count expression inside the expression in the chart.&amp;nbsp; This is so it looks at all selected data to do the calculation, not just the slice passed to the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. The expression needs to contain the same set analysis expression as is used in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final piece is the expression in the chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; above(total count(DISTINCT _Customer) , $(vintCountLoginPlatforms))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John Wildanger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 04:06:46 GMT</pubDate>
    <dc:creator>jjwild00</dc:creator>
    <dc:date>2014-12-11T04:06:46Z</dc:date>
    <item>
      <title>Above() Function On Different Dimension (for chart showing % change since last data point)</title>
      <link>https://community.qlik.com/t5/QlikView/Above-Function-On-Different-Dimension-for-chart-showing-change/m-p/798608#M282001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a line graph that has two dimensions:&lt;/P&gt;&lt;P&gt;- Week Ending&lt;/P&gt;&lt;P&gt;- Type of user device used to access a web site (iPhone, iPad, Desktop PC, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression is the number of logins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;They also want a Week Over Week graph where the value represents the percentage change in logins since the prior week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have to have an expression that compares&amp;nbsp; the current week and the prior week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I could use above() to access the prior week's data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the chart has to have the week ending dates as the first sort field so the week ending dates can be on the &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;x axis.&amp;nbsp; &lt;/SPAN&gt;This means that above() gives me the value for the prior user device for the same week, not the prior week for the same user device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought about using above(expression, offset) where offset was a variable representing the number of user devices in the currently selected data.&amp;nbsp; If all devices showed at all times in the chart, this would work.&amp;nbsp; However, they don't all always show.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any ideas on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Dec 2014 01:34:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Above-Function-On-Different-Dimension-for-chart-showing-change/m-p/798608#M282001</guid>
      <dc:creator>jjwild00</dc:creator>
      <dc:date>2014-12-09T01:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Above() Function On Different Dimension (for chart showing % change since last data point)</title>
      <link>https://community.qlik.com/t5/QlikView/Above-Function-On-Different-Dimension-for-chart-showing-change/m-p/798609#M282002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked around some more on the site and it looks like others are trying to find the same solution that I am.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I looked harder at this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realized that I could calculate how many rows to climb up the chart to get to the prior week's value for the current user device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three factors in the solution I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first is a variable that contains the currently selected field in the cycle group on the chart.&amp;nbsp; (The cycle group part of the problem was not mentioned by me in the initial post.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vstrCurrentField =GetCurrentField([Platforms])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The next sets a variable to the number of these items in the currently selected data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vintCountLoginPlatforms =count({&amp;lt;RecordType={'Login'}&amp;gt;} DISTINCT [$(vstrCurrentField)])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are three important points here:&lt;/P&gt;&lt;P&gt;1. You need to have the fieldname from the cycle group in a variable. DISTINCT [GetCurrentField(Platforms)] would not work.&amp;nbsp; QV does not know to evaluate the function in that location.&amp;nbsp; There is a more general issue as well, that GetCurrentField(Platforms) returns a text value.&amp;nbsp; I have had situations where I needed this value treated as a field. If you put the result of GetCurrentField() into a variable and then use the variable, QV recognizes it now as a fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. You need to have the number of platforms in a variable.&amp;nbsp; You cannot put this count expression inside the expression in the chart.&amp;nbsp; This is so it looks at all selected data to do the calculation, not just the slice passed to the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. The expression needs to contain the same set analysis expression as is used in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final piece is the expression in the chart:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; above(total count(DISTINCT _Customer) , $(vintCountLoginPlatforms))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John Wildanger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 04:06:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Above-Function-On-Different-Dimension-for-chart-showing-change/m-p/798609#M282002</guid>
      <dc:creator>jjwild00</dc:creator>
      <dc:date>2014-12-11T04:06:46Z</dc:date>
    </item>
  </channel>
</rss>

