<?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 setting the calculated dimension from a table chart to an array variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238274#M89190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would say, Miguel, that the issue is a table chart has been created from a mathematical operation on a previous table chart. Now, we wish to take this new table chart as an array and enact a formula on it, to derive a single value. For example:&lt;/P&gt;&lt;P&gt;[New table chart value1, New table chart value2.....]=[Old table chart value1, Old table chart value2...]*Value&lt;/P&gt;&lt;P&gt;What we want now is:&lt;/P&gt;&lt;P&gt;New Single Value = function([New table chart value1, New table chart value2....])&lt;/P&gt;&lt;P&gt;Is this even possible in qlikview?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Mar 2011 11:14:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-08T11:14:41Z</dc:date>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238270#M89186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a simpl table chart with columns Date and PnL. The PnL is calculated as a sum of (stock quantity * stock price) for a list of stocks for each date. I want to be able to refer to the PnL column list of values into an array variable that can be reused for doing a calculation to a single value. The formula is&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;STRONG&gt;round&lt;/STRONG&gt;(min([PnL],round(count([PnL])*(1-ConfidenceLevel)))*sqrt(YearProjection),.01)&lt;/P&gt;&lt;P&gt;where ConfidenceLevel and YearProjection are input values from a slider.&lt;/P&gt;&lt;P&gt;Many thanks is advance for your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 18:41:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238270#M89186</guid>
      <dc:creator />
      <dc:date>2011-03-03T18:41:32Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238271#M89187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Your formula maybe could be expressed like as follow:&lt;/P&gt;&lt;P&gt;round(min(([stock price] * [stock quantity]),round(count(distinct Date)*(1-v_ConfidenceLevel)))*sqrt(v_YearProjection),.01)&lt;/P&gt;&lt;P&gt;For Understanding, count(PnL) is the same than count(Date), I suppose it's the number of elements, isn't it?&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 13:21:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238271#M89187</guid>
      <dc:creator />
      <dc:date>2011-03-07T13:21:44Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238272#M89188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Modifying the calculation has a glitch as we need to refer to the sum(stock_quantity * price) for a list of stocks on a given date. The PnL calculated column does that for you.&lt;/P&gt;&lt;P&gt;Is it not possible to refer to a calculated column directly ? How best to do this ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Mar 2011 18:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238272#M89188</guid>
      <dc:creator />
      <dc:date>2011-03-07T18:31:43Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238273#M89189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Refer to a calculated column directly depends what are you exactly looking for, if you could attach a file with a detailed example (what is the expected result) maybe I could help you.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 10:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238273#M89189</guid>
      <dc:creator />
      <dc:date>2011-03-08T10:50:34Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238274#M89190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would say, Miguel, that the issue is a table chart has been created from a mathematical operation on a previous table chart. Now, we wish to take this new table chart as an array and enact a formula on it, to derive a single value. For example:&lt;/P&gt;&lt;P&gt;[New table chart value1, New table chart value2.....]=[Old table chart value1, Old table chart value2...]*Value&lt;/P&gt;&lt;P&gt;What we want now is:&lt;/P&gt;&lt;P&gt;New Single Value = function([New table chart value1, New table chart value2....])&lt;/P&gt;&lt;P&gt;Is this even possible in qlikview?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 11:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238274#M89190</guid>
      <dc:creator />
      <dc:date>2011-03-08T11:14:41Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238275#M89191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/8883.varapp.zip:550:0]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the application that we have done so far in a zip file with the data set. There is one table (Portfolio PnL) that is pre-calculated as part of script load and therefore doesn't change with stock or date selections. The VaR calculation is based on the PnL column in (Portfolio PnL) table.&lt;/P&gt;&lt;P&gt;However, there is another table Calculated PnL with a PnLCalc column that is an expression of sum(Return * StockQty).Unlike the PortfolioPnL table, the Calculated PnL table changes with stock or date selections.&lt;/P&gt;&lt;P&gt;What we need is to refer to the PnLCalc column in Calculated PnL and include that in our VaR calculation, which basically is to get to a PnLCalc value for a given date based on a function. More about this on James Kniep's post.&lt;/P&gt;&lt;P&gt;Hope this explains in detail what we are trying to do.&lt;/P&gt;&lt;P&gt;Look forward to your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 11:31:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238275#M89191</guid>
      <dc:creator />
      <dc:date>2011-03-08T11:31:04Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238276#M89192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;I've checked out the example and I have some questions:&lt;/P&gt;&lt;P&gt;At the formula: round(min([PnL],round(count([PnL])*(1-ConfidenceLevel)))*sqrt(YearProjection),.01)&lt;/P&gt;&lt;P&gt;Is the PnL used from the table Portaflio or from Calculated PnL?&lt;/P&gt;&lt;P&gt;Is the given date from a filter on Date field or using a input field?&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 16:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238276#M89192</guid>
      <dc:creator />
      <dc:date>2011-03-10T16:57:21Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238277#M89193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Judging by your question - i don't think you have understood our problem.&lt;/P&gt;&lt;P&gt;In the formula - PnL refers to Portfolio table.&lt;/P&gt;&lt;P&gt;It can't be the Calculated PnL table - as the column is calculated. We ideally want to refer to this calculated column in the CalcPnL table.&lt;/P&gt;&lt;P&gt;Don't understand your second question. The Date is never filtered unless you select one of the date's in the table. There is no input box for a date. They are all loaded from the data files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 17:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238277#M89193</guid>
      <dc:creator />
      <dc:date>2011-03-10T17:14:10Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238278#M89194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to be clear and avoid confusion, let's stick to the common terminology - when we say "Table", we typically refer to a Database Table, as opposed to sheet objects like Table Box or a Straight Table Chart.&lt;/P&gt;&lt;P&gt;If you have an Expression (not Calculated Dimension!), the result of the Expression can be referenced within the same chart, but not in another chart. Within the same chart, an Expression can be referenced either by Name (Expression Label) or by number, using function Column(nnn).&lt;/P&gt;&lt;P&gt;Outside of the same chart, the results of an Expression cannot be re-used - you'd have to repeat the same formula again, and QlikView will recalculate it in the context of the given Dimensions.&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 17:21:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238278#M89194</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-03-10T17:21:54Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238279#M89195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;That clarifies our confusion. We are trying to solve the problem using a reusable formula.&lt;/P&gt;&lt;P&gt;Is there a function in qlikview to get the total no. of distinct rows for a given column. We are using the formula below&lt;/P&gt;&lt;P&gt;=-1*sum(Return * StockQty) * (round(count(distinct Date)*&lt;B&gt;&lt;I&gt;ConfidenceLevel&lt;/I&gt;&lt;/B&gt;)=Rank(sum(Return * StockQty)))&lt;/P&gt;&lt;P&gt;where it fails with value 0.&lt;/P&gt;&lt;P&gt;This however works fine if the above formula is substituted with a specific number -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=-1*sum(Return * StockQty) * (5=Rank(sum(Return * StockQty)))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Return, Date, StockQty are valid loaded values.&lt;/P&gt;&lt;P&gt;ConfidenceLevel is a variable with a value between .9 and 1 (picked up via a slider).&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2011 18:20:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238279#M89195</guid>
      <dc:creator />
      <dc:date>2011-03-10T18:20:11Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238280#M89196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Sorry but I don't understan your problem yet, one thing is true, you can't reference a column value from another chart, like Oleg said, you have to repeat the expresion.&lt;/P&gt;&lt;P&gt;So, one thing is clear, you need the value PnL from the Portaflio table, ok, but the formula at the first post, the formula in the zip file and the formula in the sanjeevi_n post aren't the same, so, I don't have a clear idea what are you looking for, could you attach a excel with the expected result and explaining it clearly?.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 07:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238280#M89196</guid>
      <dc:creator />
      <dc:date>2011-03-11T07:58:13Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238281#M89197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Perhaps I can clarify the question a little more, as I have been working with sanjeevi_n on the same project. Please find attached an Excel version of the dashboard which we are trying to replicate in Qlikview.&lt;/P&gt;&lt;P&gt;Our ultimate goal is reproducing the Hist. VaR calculation you will see just to the left of the chart. This is essentially done by taking the nth ranked value (n being determined by a user input) of the portfolio returns. The formulae that have been introduced are intended to do just that.&lt;/P&gt;&lt;P&gt;We understand now that it is impossible for variables declared outside a chart to reference calculated values in a chart, but now we are having trouble with the latest formula, which is being used within the chart where the values are created:&lt;/P&gt;&lt;P&gt;-1*sum(StockQty*Return) * (Rank(sum(Return * StockQty))=round(count(distinct Date)*&lt;B&gt;&lt;I&gt;ConfidenceLevel&lt;/I&gt;&lt;/B&gt;))&lt;/P&gt;&lt;P&gt;This formula is implemented in the chart where we calculate the portfolio values, represented by sum(StockQty* Return). The formula will work fine if there is a number on the RHS of the equation, but when we substitute these non-numerical terms (which we have tested, and produce a proper number), we get the wrong answer.&lt;/P&gt;&lt;P&gt;I hope this answers your questions, so you can hopefully answer ours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2011 13:00:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238281#M89197</guid>
      <dc:creator />
      <dc:date>2011-03-11T13:00:41Z</dc:date>
    </item>
    <item>
      <title>setting the calculated dimension from a table chart to an array variable</title>
      <link>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238282#M89198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here you are a possible solution, I've tried do the same as like excel file.&lt;/P&gt;&lt;P&gt;All is almost done, but, there is one thing I couldn't do, calculating the Percentile, I've tried with the function rangefractile but I think that isn't what are you looking for (additionaly it doesn't work like rangesum does), so, you have to find the right expression.&lt;/P&gt;&lt;P&gt;For it works you have to load the data ordered by Date field, check the script.&lt;/P&gt;&lt;P&gt;There are some variables created for limiting the data and calculating the date according to the user selection.&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Mar 2011 13:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/setting-the-calculated-dimension-from-a-table-chart-to-an-array/m-p/238282#M89198</guid>
      <dc:creator />
      <dc:date>2011-03-12T13:47:20Z</dc:date>
    </item>
  </channel>
</rss>

