<?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: Bar Chart percentage on row in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126283#M91663</link>
    <description>&lt;P&gt;I'd create a variable that contains the dynamically selected dimension:&lt;BR /&gt;&lt;BR /&gt;vDim =&amp;nbsp;if(&lt;SPAN&gt;'$(vWDM)'='W', 'week_starting',&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='D', '=date(floor(order_creation_date))',&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='M', 'monthyear ')))&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;and then use the same variable in the calculated dimension and in the TOTAL qualilfier:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Count(distinct order_code) / Count(distinct total &amp;lt;$(vDim)&amp;gt; order_code)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Also, I'd calculate the order date in the script, to keep this formula cleaner:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;...,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;date(floor(order_creation_date)) as order_date,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Now, if something doesn't work they way you expected, please provide some details.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 07 Oct 2023 15:24:07 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2023-10-07T15:24:07Z</dc:date>
    <item>
      <title>Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126143#M91647</link>
      <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;my bar chart at the moment shows the relative "% of order" for each plan type against the whole total.&lt;BR /&gt;This is my set analysis at the moment: =Count(distinct order_code) / Count(total distinct order_code)&lt;/P&gt;
&lt;P&gt;How can I make that to be evaluated against each row? For example, the 100% will be the total for each week and not the whole dataset. Is that achievable in Qlik sense? Many thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MZambo89_0-1696606913932.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/117812iA13D8D84D6A2779A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MZambo89_0-1696606913932.png" alt="MZambo89_0-1696606913932.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 15:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126143#M91647</guid>
      <dc:creator>MZqlik</dc:creator>
      <dc:date>2023-10-06T15:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126183#M91648</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For the record - this is not set analysis, this is just an expression, but that's just a matter of terminology.&lt;/P&gt;
&lt;P&gt;To answer your question - yes, you can divide by weekly totals. Assuming that you have a field like Week in your calendar, you could add it to the TOTAL qualifier, like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Count(distinct order_code) / Count(distinct total &amp;lt;Week&amp;gt; order_code)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 17:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126183#M91648</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-10-06T17:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126259#M91656</link>
      <description>&lt;P&gt;Hi Oleg,&lt;BR /&gt;yes, apologies for the misuse of the terminology.&amp;nbsp;&lt;BR /&gt;The complication is that I have an X-axis which is dynamic so the user can swap between weeks, days and months.&lt;BR /&gt;I did this using a variable and an if statement in the x-axis:&lt;/P&gt;
&lt;DIV&gt;=if(&lt;SPAN&gt;'$(vWDM)'='W', week_starting,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='D', date(floor(order_creation_date)),&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='M', monthyear&amp;nbsp;),),&amp;nbsp;)&lt;BR /&gt;&lt;BR /&gt;How can I incorporate that into the expression? Thank you&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 09:56:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126259#M91656</guid>
      <dc:creator>MZqlik</dc:creator>
      <dc:date>2023-10-07T09:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126261#M91657</link>
      <description>&lt;P&gt;Also, that formula that expression would have not worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 10:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126261#M91657</guid>
      <dc:creator>MZqlik</dc:creator>
      <dc:date>2023-10-07T10:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126283#M91663</link>
      <description>&lt;P&gt;I'd create a variable that contains the dynamically selected dimension:&lt;BR /&gt;&lt;BR /&gt;vDim =&amp;nbsp;if(&lt;SPAN&gt;'$(vWDM)'='W', 'week_starting',&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='D', '=date(floor(order_creation_date))',&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; if('$(vWDM)'='M', 'monthyear ')))&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;and then use the same variable in the calculated dimension and in the TOTAL qualilfier:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Count(distinct order_code) / Count(distinct total &amp;lt;$(vDim)&amp;gt; order_code)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Also, I'd calculate the order date in the script, to keep this formula cleaner:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;LOAD&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;...,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;date(floor(order_creation_date)) as order_date,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Now, if something doesn't work they way you expected, please provide some details.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 07 Oct 2023 15:24:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126283#M91663</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-10-07T15:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126287#M91664</link>
      <description>&lt;P&gt;it doesn't work as well. It becomes 1:1 so everything 100%.&lt;BR /&gt;I have done that already to transform the date in the load. At one point I was playing with the incremental load and I needed the timestamp so I had to put that there temporarily.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 15:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126287#M91664</guid>
      <dc:creator>MZqlik</dc:creator>
      <dc:date>2023-10-07T15:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bar Chart percentage on row</title>
      <link>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126294#M91665</link>
      <description>&lt;P&gt;I was doing a bit of test and it is very odd what is happening:&lt;BR /&gt;if I put on the x axis dimension = week_starting and then the set expesison as&amp;nbsp;Count(distinct order_code)&lt;BR /&gt;/&lt;BR /&gt;Count(distinct total &amp;lt; week_starting &amp;gt; order_code) this will work.&lt;/P&gt;
&lt;P&gt;If I put this in the&amp;nbsp; measure then it doesn't work as above but technically it should. right?&lt;BR /&gt;&lt;BR /&gt;=if( '$(vWDM)'='W',&lt;BR /&gt;(Count(distinct order_code)/Count(distinct total &amp;lt; week_starting &amp;gt; order_code) ),&lt;BR /&gt;if('$(vWDM)'='D',&lt;BR /&gt;(Count(distinct order_code)/Count(distinct total &amp;lt; order_creation_date &amp;gt; order_code) ),&lt;BR /&gt;if('$(vWDM)'='M',&lt;BR /&gt;(Count(distinct order_code)/Count(distinct total &amp;lt; monthyear &amp;gt; order_code) ) ), ), )&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2023 18:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Bar-Chart-percentage-on-row/m-p/2126294#M91665</guid>
      <dc:creator>MZqlik</dc:creator>
      <dc:date>2023-10-07T18:17:52Z</dc:date>
    </item>
  </channel>
</rss>

