<?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 Dynamic formatting of a bar chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896164#M12451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlik Sense&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way of dynamically changing a format of a bar chart depending on its values....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some rows of data are for percentages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apples 75%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workers 1008&amp;nbsp; and some are just number values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when a bar chart is used its formatted for percentages...when the selected apples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however when someone selected workers...its showing in percentage (it would)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way to dynamically change the formatting if a "Format"column was added with eg... number or percentage?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could I use expression formatting code similar to this ? and if yes... is this correct way to do it???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(([TargetValue] AND [Format] = 'Percentage')&lt;/P&gt;&lt;P&gt;OR ([TargetValue] AND [Format] = 'Number'), %(), Number())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or can a small drop down be added? users can use on the sheet of the app and just select format percentage or number? this will dynamically change the formatting of the bar chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas please?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joeybird&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Apr 2015 14:42:20 GMT</pubDate>
    <dc:creator>joeybird</dc:creator>
    <dc:date>2015-04-23T14:42:20Z</dc:date>
    <item>
      <title>Dynamic formatting of a bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896164#M12451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlik Sense&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way of dynamically changing a format of a bar chart depending on its values....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some rows of data are for percentages&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;apples 75%&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;workers 1008&amp;nbsp; and some are just number values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when a bar chart is used its formatted for percentages...when the selected apples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however when someone selected workers...its showing in percentage (it would)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there a way to dynamically change the formatting if a "Format"column was added with eg... number or percentage?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could I use expression formatting code similar to this ? and if yes... is this correct way to do it???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(([TargetValue] AND [Format] = 'Percentage')&lt;/P&gt;&lt;P&gt;OR ([TargetValue] AND [Format] = 'Number'), %(), Number())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or can a small drop down be added? users can use on the sheet of the app and just select format percentage or number? this will dynamically change the formatting of the bar chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any ideas please?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joeybird&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2015 14:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896164#M12451</guid>
      <dc:creator>joeybird</dc:creator>
      <dc:date>2015-04-23T14:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic formatting of a bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896165#M12452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - i did get this to work.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Build a 2 row (or more) data island table in the data model with each row determining a 'format code'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Format:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;&amp;nbsp; if(RowNo()=1,'Percentage','Integer') as Format&lt;/P&gt;&lt;P&gt;AutoGenerate 2;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Build a variable to determine the numeric format based on the selection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vFormat='if(Only(Format)=' &amp;amp; chr(39) &amp;amp; 'Integer' &amp;amp; chr(39) &amp;amp;',' &amp;amp;chr(39)&amp;amp; '#,##0' &amp;amp; chr(39) &amp;amp; ',' &amp;amp; chr(39) &amp;amp; '#,##0%' &amp;amp; chr(39) &amp;amp; ')';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Invoke the variable in the 2nd argument of the num() function to dynamically determine the format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change measure expression from:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num( sum(Sales), $(= chr(39) &amp;amp; $(=$(vFormat)) &amp;amp; chr(39)) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and leave format to 'auto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2015 12:44:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896165#M12452</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2015-04-24T12:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic formatting of a bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896166#M12453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code worked amazing, however it does not like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;&amp;nbsp; if(RowNo()=1,'Percentage','Integer') as Format&lt;/P&gt;&lt;P&gt;AutoGenerate 2;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all I did was create the extra column called format, and said if the row was Percentage or Integer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then used all the rest of the instructions and hay presto.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joeybird&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Apr 2015 14:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/896166#M12453</guid>
      <dc:creator>joeybird</dc:creator>
      <dc:date>2015-04-24T14:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic formatting of a bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/1675924#M51372</link>
      <description>&lt;P&gt;Hi JonnyPoole,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your solution below, it brings me close to resolving my issue but i am still missing something. I am working on QlikSense April,2019 and running into an issue with dynamic formatting in Line chart. The expression seems to work fine in a table box though.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My user needs to cycle through 50+ extensions via a drop down and for each measure selected needs to show its trend over time on a line chart. I used an inline table and created 50 measures and in the front end i use pick match as in below example.&lt;/P&gt;&lt;P&gt;pick(match(Measure,1,2,3),&lt;/P&gt;&lt;P&gt;num(sum(A),'#,###.00'),&lt;/P&gt;&lt;P&gt;num(Sum(B),'$#,###.00'),&lt;/P&gt;&lt;P&gt;num(Sum(C),'##.#0%')&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;The number and currency format work fine , the percentage format however does not convert on the y axis. If you hover over the value points they show up in percentage format but the axis does not.&lt;/P&gt;&lt;P&gt;I have used your solution by creating a new field in the inline table called MetricFormat and its values are like Integer,Percentage.I then created a variable vFormat in the front end like this&lt;/P&gt;&lt;P&gt;='if(Only(MetricFormat)=' &amp;amp; chr(39) &amp;amp; 'Integer' &amp;amp; chr(39) &amp;amp;',' &amp;amp;chr(39)&amp;amp; '#,##0' &amp;amp; chr(39) &amp;amp; ',' &amp;amp; chr(39) &amp;amp; '#,##0%' &amp;amp; chr(39) &amp;amp; ')'&lt;/P&gt;&lt;P&gt;If I pull this variable in a text object i can see it is working as expected for Measure 3 i.e. it shows percent format.&lt;/P&gt;&lt;P&gt;Inside the Line chart expression i use it as below but still the axis doesnt reflect percent format&lt;/P&gt;&lt;P&gt;num(sum(C),$(=chr(39)&amp;amp;$(=$(vFormat))&amp;amp;chr(39)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;the validation popup in the expression editor doesn't seem to be finding the string after the comma. it just sees num(sum(C), ) Any ideas what i am doing wrong?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 22:58:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-formatting-of-a-bar-chart/m-p/1675924#M51372</guid>
      <dc:creator>sabreyals</dc:creator>
      <dc:date>2020-02-14T22:58:13Z</dc:date>
    </item>
  </channel>
</rss>

