<?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: Read resident table in VBScript Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530430#M1147428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expressions themself are static but the content is dynamically:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expr1 = $(expr1)&lt;/P&gt;&lt;P&gt;expr2 = $(expr2)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same could be done with the label and comment from the expression and also by the conditions which then control different number of expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Jul 2013 19:23:51 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2013-07-27T19:23:51Z</dc:date>
    <item>
      <title>Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530427#M1147425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I currently have a table which controls the display of certain measures in a macro.&amp;nbsp; Right now I am reading from a database via ADO to capture this table in my macro, but I was wondering if I could more easily read from the table line by line in a recordset directly from QV after loading the table in the script.&amp;nbsp; This would be much more efficient and failsafe.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my macro below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Public Sub FetchRollups&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; selectedLevel = ActiveDocument.fields("Levels").GetSelectedValues.Item(0).Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim conn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Instantiate connection and recordset objects&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set conn = CreateObject("ADODB.Connection")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set rs = CreateObject("ADODB.Recordset")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Open the connection and capture the P&amp;amp;L Rollup table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.ConnectionString = "DSN=CXAPPSVR03"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.Open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set rs = conn.Execute("SELECT * FROM TEST.DBO.C_X_PLDEF WHERE LEVEL &amp;lt;= " &amp;amp; selectedLevel)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Grab the relevant chart and associated properties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set chart = ActiveDocument.GetSheetObject("CH02")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prevcount = chart.GetProperties.Expressions.Count&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add all expressions from recordset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While not rs.EOF&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add expression and capture its ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = chart.AddExpression(rs("ExpressionValue").Value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Set expression properties such as label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set prop = chart.GetProperties&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prop.Expressions.Item(x).Item(0).Data.ExpressionVisual.Label.v = String(rs("Level")*3, " ") &amp;amp; rs("ExpressionText").Value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chart.SetProperties prop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Continue Loop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rs.MoveNext&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Delete old pdimensions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for y=prevcount-1 to 0 Step -1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chart.RemoveExpression y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Cleanup chart&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'chart.SetPixWidth 0,200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; conn.Close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'chart.SetProperties p&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 20:53:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530427#M1147425</guid>
      <dc:creator />
      <dc:date>2013-07-26T20:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530428#M1147426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could load your expression-table directly in the load-script and put each one afterwards in a variable and use these variables as expression. A macro wont needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ExpressionsTable:&lt;/P&gt;&lt;P&gt;Select * From ExpressionFrom Database;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 1 to FieldValueCount('Expressions')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set expr1 = peek('Expressions', $(i) - 1, 'ExpressionsTable');&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 18:44:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530428#M1147426</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-07-27T18:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530429#M1147427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But then how do I get these expressions into a pivot table dynamically?  There can be a different number of expressions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 19:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530429#M1147427</guid>
      <dc:creator />
      <dc:date>2013-07-27T19:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530430#M1147428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expressions themself are static but the content is dynamically:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expr1 = $(expr1)&lt;/P&gt;&lt;P&gt;expr2 = $(expr2)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same could be done with the label and comment from the expression and also by the conditions which then control different number of expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 19:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530430#M1147428</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-07-27T19:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530431#M1147429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm confused.  How would I control the number of expressions conditionally displayed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jul 2013 20:51:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530431#M1147429</guid>
      <dc:creator />
      <dc:date>2013-07-27T20:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530432#M1147430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Conditions for dimensions/expressions are only available since QV 11. Your expressions-record could beside the label, expression and comment also have a field for the condition - a simply true/false or also an expression on any fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use a version older as QV 11 you can't control the number of expressions on this way, then you must put the expressions with a macro. But the load the expressions from the database into a table/fields/variables could be done and then per macro with an OnOpen-Trigger put in the chart you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Jul 2013 08:34:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530432#M1147430</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-07-28T08:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530433#M1147431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All - I don't think the above solution is going to work.&amp;nbsp; I simply have too many conditional expressions, and the performance is terrible.&amp;nbsp; My macro is really only slow because I am reading a Table Box.&amp;nbsp; That read process is incredibly slow based on me commenting in and our parts of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There has to be an easier way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2013 21:01:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530433#M1147431</guid>
      <dc:creator />
      <dc:date>2013-07-29T21:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530434#M1147432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It isn't really clear what you mean. The dynamically befilling from the expressions (with which solution) is too slow or the calculations from these objects by open/select?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2013 07:35:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530434#M1147432</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-07-30T07:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530435#M1147433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same requirement - reading a resident table in macro code. Reading through a front-end object is just too slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 10:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530435#M1147433</guid>
      <dc:creator>jarno_loubser</dc:creator>
      <dc:date>2013-12-11T10:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530436#M1147434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fastest way to read a table is always directly within a load-statement. If you couldn't work with dynamically expressions per variables, you could also create a tablebox with these data within the gui and read these object in a loop per macro. I didn't understand what should be too slow with such a solutions ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 11:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530436#M1147434</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-12-11T11:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530437#M1147435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please see &lt;A _jive_internal="true" href="https://community.qlik.com/thread/101563"&gt;http://community.qlik.com/thread/101563&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 11:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530437#M1147435</guid>
      <dc:creator>jarno_loubser</dc:creator>
      <dc:date>2013-12-11T11:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read resident table in VBScript Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530438#M1147436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't the same requirement - you want change values and not set properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 12:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-resident-table-in-VBScript-Macro/m-p/530438#M1147436</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2013-12-11T12:24:12Z</dc:date>
    </item>
  </channel>
</rss>

