<?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: how can i store a total no of rows of a straight table in a variable? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/how-can-i-store-a-total-no-of-rows-of-a-straight-table-in-a/m-p/360506#M578829</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way you could work around this is to create a variable in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you had a table named table.&lt;/P&gt;&lt;P&gt;Let a = NoOfRows('table')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A more complicated way that doesnt involve the script involves the use of a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new variable called NoOfRows, leave the definition blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open up the macro menu and type in the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub temp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.GetSheetObject("&lt;STRONG&gt;CH01*&lt;/STRONG&gt;")&lt;/P&gt;&lt;P&gt;ActiveDocument.Variables("NoOfRows").SetContent obj.GetRowCount, true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*Note that you will name this the object ID of whatever your straight table is. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now open up settings-&amp;gt;Document properties...-&amp;gt;&lt;STRONG&gt;OnAnySelect**&lt;/STRONG&gt;-&amp;gt;Add Actions...-&amp;gt;External-&amp;gt;Run Macro-&amp;gt;Macro name is temp then apply down the list.&amp;nbsp; Now whenever you make a selection it will store the number of rows from "CH01" or whatever your straight table is into the variable NoOfRows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Keep in mind you can change when the macro gets run for your preferences by defining the same thing for OnOpen, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a working .qvw for additional support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2012 18:38:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-20T18:38:51Z</dc:date>
    <item>
      <title>how can i store a total no of rows of a straight table in a variable?</title>
      <link>https://community.qlik.com/t5/QlikView/how-can-i-store-a-total-no-of-rows-of-a-straight-table-in-a/m-p/360505#M578828</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;&lt;/P&gt;&lt;P&gt;I have a straight table. i want to store the no of rows in a variable. how can i achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sushil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 17:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-can-i-store-a-total-no-of-rows-of-a-straight-table-in-a/m-p/360505#M578828</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2012-03-20T17:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: how can i store a total no of rows of a straight table in a variable?</title>
      <link>https://community.qlik.com/t5/QlikView/how-can-i-store-a-total-no-of-rows-of-a-straight-table-in-a/m-p/360506#M578829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way you could work around this is to create a variable in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you had a table named table.&lt;/P&gt;&lt;P&gt;Let a = NoOfRows('table')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A more complicated way that doesnt involve the script involves the use of a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new variable called NoOfRows, leave the definition blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open up the macro menu and type in the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub temp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.GetSheetObject("&lt;STRONG&gt;CH01*&lt;/STRONG&gt;")&lt;/P&gt;&lt;P&gt;ActiveDocument.Variables("NoOfRows").SetContent obj.GetRowCount, true&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*Note that you will name this the object ID of whatever your straight table is. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now open up settings-&amp;gt;Document properties...-&amp;gt;&lt;STRONG&gt;OnAnySelect**&lt;/STRONG&gt;-&amp;gt;Add Actions...-&amp;gt;External-&amp;gt;Run Macro-&amp;gt;Macro name is temp then apply down the list.&amp;nbsp; Now whenever you make a selection it will store the number of rows from "CH01" or whatever your straight table is into the variable NoOfRows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Keep in mind you can change when the macro gets run for your preferences by defining the same thing for OnOpen, etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a working .qvw for additional support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 18:38:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/how-can-i-store-a-total-no-of-rows-of-a-straight-table-in-a/m-p/360506#M578829</guid>
      <dc:creator />
      <dc:date>2012-03-20T18:38:51Z</dc:date>
    </item>
  </channel>
</rss>

