<?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: Can I set a variable in Chart Dimension? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858455#M300686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Join is &lt;STRONG&gt;NOT&lt;/STRONG&gt; the only option available when you do this in the script. There are other like using mapping load together with apply map or Lookup function to get it done as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sunny &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Apr 2015 18:45:29 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-04-21T18:45:29Z</dc:date>
    <item>
      <title>Can I set a variable in Chart Dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858451#M300682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I calculate a value based upon two other record values. Here is an example:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;round(60*24*(10000*Num(CallTime) - left(subfield(date#(CreationDate),'.',2),4))/10000)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The issue is that I want to add 720 if it is less than -270 and then set to null if it is still less than 0 or more than 270.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;I can do this with a bunch of nested if statements in the calculated dimension but it will look cumbersome and be error prone if I need to make changes. Is there a place where I can calculate the value for each record and then refer to it by the variable name? I tried to do it in the load but didn't have much luck. I thought it would be more logical to define it in the dimension but it didn't seem possible. Not sure which approach is best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;On a somewhat unrelated note I also was surprised that Median was not an option when totaling values for expressions. Of course I wanted to get the Median for the calculated dimension which doesn't seem doable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 19:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858451#M300682</guid>
      <dc:creator />
      <dc:date>2015-04-17T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I set a variable in Chart Dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858452#M300683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you say "two other record values" - do you mean two different columns in a chart table? &lt;/P&gt;&lt;P&gt;Is CallTime and CreationTime in the same in-memory table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 20:05:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858452#M300683</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-04-17T20:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can I set a variable in Chart Dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858453#M300684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can def. use variables in your dimension. You can have one variable which does all the things, or you can have it in pieces.&lt;/P&gt;&lt;P&gt;(I mean this when I say pieces)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If($(vVar1)&amp;nbsp; &amp;lt; -270, If($(vVar1) + 720 &amp;lt; -270, Null(), $(vVar1) + 720), $(vVar1))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My only concern is that if conditions in the dimensions usually slow down the application, so if there is any possibility of doing this in the script, I would recommend you going that route.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 20:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858453#M300684</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-17T20:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I set a variable in Chart Dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858454#M300685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CallTime and CreationDate are loaded from seperate tables. Should I load this calculation in the script by joing these two tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do understand that a variable can be referenced in the dimention, but can it be set there? It doesn't seem that I can set it there although it makes logical sense for me to do so. So if I have to define it in the load script it seems that I can't reference the previously loaded values but rather have to do the calculation in a query that joins the tables together. Is this right? @&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;sunindia&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 18:41:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858454#M300685</guid>
      <dc:creator />
      <dc:date>2015-04-21T18:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I set a variable in Chart Dimension?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858455#M300686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Join is &lt;STRONG&gt;NOT&lt;/STRONG&gt; the only option available when you do this in the script. There are other like using mapping load together with apply map or Lookup function to get it done as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Sunny &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 18:45:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-set-a-variable-in-Chart-Dimension/m-p/858455#M300686</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-04-21T18:45:29Z</dc:date>
    </item>
  </channel>
</rss>

