<?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: Macro for dynamic chart in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364595#M417820</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Imran,&lt;/P&gt;&lt;P&gt;It looks like you have the same problem someone had once... Look at this thred:&lt;A href="https://community.qlik.com/thread/134324"&gt;set Chart Type&lt;/A&gt;&lt;/P&gt;&lt;P&gt;, and if you need additional help let us know.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Apr 2017 15:30:07 GMT</pubDate>
    <dc:creator>hector_munoz</dc:creator>
    <dc:date>2017-04-07T15:30:07Z</dc:date>
    <item>
      <title>Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364594#M417819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to have dynamic chart based on selection from particular fields. In attached app, I am able to change the chart type from line chart to straight table or vice versa(through macro).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I would like to have an addition of some codes in existing macro which will defined chart type basis on my selection from account field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example: If i select Account 1 then it will show scatter chart, if I select Account 2 then it will show line chart and if I select Account 3 then straight table will be the view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the macro which i have used in attached app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub SetChartType&lt;/P&gt;&lt;P&gt;&amp;nbsp; set chart = ActiveDocument.GetSheetObject("CH04")&lt;/P&gt;&lt;P&gt;&amp;nbsp; intObjectType = chart.GetObjectType&lt;/P&gt;&lt;P&gt;&amp;nbsp; if intObjectType = 15 then&amp;nbsp;&amp;nbsp;&amp;nbsp; 'is currently a line chart&lt;/P&gt;&lt;P&gt;&amp;nbsp; chart.SetChartType&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; else &lt;/P&gt;&lt;P&gt;&amp;nbsp; chart.SetChartType&amp;nbsp; 4&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly advise how to write in macro to achieve above output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Imran Khan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 14:31:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364594#M417819</guid>
      <dc:creator>khan_imran</dc:creator>
      <dc:date>2017-04-07T14:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364595#M417820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Imran,&lt;/P&gt;&lt;P&gt;It looks like you have the same problem someone had once... Look at this thred:&lt;A href="https://community.qlik.com/thread/134324"&gt;set Chart Type&lt;/A&gt;&lt;/P&gt;&lt;P&gt;, and if you need additional help let us know.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Apr 2017 15:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364595#M417820</guid>
      <dc:creator>hector_munoz</dc:creator>
      <dc:date>2017-04-07T15:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364596#M417821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some macro which will change the chart type based on field selection. I have mentioned my requirement in my original post. &lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Imran Khan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Apr 2017 09:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364596#M417821</guid>
      <dc:creator>khan_imran</dc:creator>
      <dc:date>2017-04-08T09:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364597#M417822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK... Take a look to the attached sample.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Apr 2017 15:17:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364597#M417822</guid>
      <dc:creator>hector_munoz</dc:creator>
      <dc:date>2017-04-08T15:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364598#M417823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for solution, but how would you do that? I want to have just 3 charts i.e. Line Chart, Scatter Chart and Bar Chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads,&lt;/P&gt;&lt;P&gt;Imran Khan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Apr 2017 10:30:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364598#M417823</guid>
      <dc:creator>khan_imran</dc:creator>
      <dc:date>2017-04-09T10:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364599#M417824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK Imran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step by step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a chart of one of the desired types (eg bar chart) and select the type of compatible charts in fast change menu. In the below sample, we create a bar chart with fast change to bar chart, line chart and scatter chart. Take note of the objetc ID because we will need it when creating the necessary macro (in this case CH01):&lt;BR /&gt;&lt;BR /&gt;&lt;IMG alt="09-04-2017 13-04-56.png" class="jive-image image-1" src="/legacyfs/online/159510_09-04-2017 13-04-56.png" style="height: 542px; width: 620px;" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;In script, create an INLINE table with the combination of the description of charts and its code in Qlik inner codification:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MASTER:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD * INLINE [&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;ID, DESC&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;0, Bar&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;3, Scatter&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;4, Line&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In designer, create a field box with the description for letting the user to select the desired chart and a variable that contains tha max value of the field.&lt;/LI&gt;&lt;LI&gt;Create a macro that allows the application to change the chart as the user selects the chart.&lt;/LI&gt;&lt;LI&gt;Associate the macro to the variable change: Settings &amp;gt; Document Settings &amp;gt; Triggers &amp;gt; Field Event Triggers &amp;gt; Variable Event Triggers + OnInput and OnChange&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach you another app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Apr 2017 11:30:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1364599#M417824</guid>
      <dc:creator>hector_munoz</dc:creator>
      <dc:date>2017-04-09T11:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for dynamic chart</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1548321#M440037</link>
      <description>&lt;P&gt;can I do this for drilldown select in dimention?&lt;/P&gt;</description>
      <pubDate>Sat, 23 Feb 2019 10:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-for-dynamic-chart/m-p/1548321#M440037</guid>
      <dc:creator>marjan_it</dc:creator>
      <dc:date>2019-02-23T10:05:50Z</dc:date>
    </item>
  </channel>
</rss>

