<?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 Barchart and valuelist in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531072#M38218</link>
    <description>&lt;P&gt;Hi Qlik Sense Community!&lt;/P&gt;&lt;P&gt;I try to create a barchart with a Valuelist as dimension and a relatively complex measure.&lt;/P&gt;&lt;P&gt;If I use:&lt;BR /&gt;Dimension:&lt;/P&gt;&lt;PRE&gt;=ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')&lt;/PRE&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;PRE&gt;If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Revenues &amp;lt; 80% Business Plan'
   ,
    1
   ,
If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Business Plan respected'
   ,
    2
   ,
If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Revenues &amp;gt; 120% Business Plan'
   ,
    3
  )))&lt;/PRE&gt;&lt;P&gt;it works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, instead of 1, 2, and 3, I would like to use an expression like (I've only written the code that replace '2' in the code hereabove for a easier readibility):&lt;/P&gt;&lt;PRE&gt;(...)&lt;BR /&gt;If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Business Plan respected'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;    If(PeriodSelect='Last quarter',
        // Nb of Business Plans correctly estimated
        Sum(
            Aggr(
                 If(
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;gt;= 0.8
                     AND
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;lt;= 1.2
                    ,1
                    ,0
                   )
                 , CompanyID
                )
           )

       ,
        // Nb of Business Plans correctly estimated
        Sum(
            Aggr(
                 If(
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;gt;= 0.8
                     AND
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;lt;= 1.2
                    ,1
                    ,0
                   )
                 , CompanyID
                )
           )
      )&lt;BR /&gt;(...)&lt;/PRE&gt;&lt;P&gt;where PeriodSelect is an island table in my script and is used in a filter pane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in this case, only the first case of my ValueList is considered (so only one bar is drawn). If I change the order of values within the ValueList, another bar is drawn (corresponding to the new first value of my ValueList)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's really weird and I don't know what is the best approach. In addition every change a long time before being displayed.&lt;BR /&gt;And unfortunately it will be quite difficult to sent an exemple here.&lt;/P&gt;&lt;P&gt;Do you understand what is happening here and what to do?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 06:50:26 GMT</pubDate>
    <dc:creator>fvarlet</dc:creator>
    <dc:date>2024-11-16T06:50:26Z</dc:date>
    <item>
      <title>Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531072#M38218</link>
      <description>&lt;P&gt;Hi Qlik Sense Community!&lt;/P&gt;&lt;P&gt;I try to create a barchart with a Valuelist as dimension and a relatively complex measure.&lt;/P&gt;&lt;P&gt;If I use:&lt;BR /&gt;Dimension:&lt;/P&gt;&lt;PRE&gt;=ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')&lt;/PRE&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;PRE&gt;If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Revenues &amp;lt; 80% Business Plan'
   ,
    1
   ,
If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Business Plan respected'
   ,
    2
   ,
If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Revenues &amp;gt; 120% Business Plan'
   ,
    3
  )))&lt;/PRE&gt;&lt;P&gt;it works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, instead of 1, 2, and 3, I would like to use an expression like (I've only written the code that replace '2' in the code hereabove for a easier readibility):&lt;/P&gt;&lt;PRE&gt;(...)&lt;BR /&gt;If(ValueList('Revenues &amp;lt; 80% Business Plan','Business Plan respected','Revenues &amp;gt; 120% Business Plan')='Business Plan respected'&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;    If(PeriodSelect='Last quarter',
        // Nb of Business Plans correctly estimated
        Sum(
            Aggr(
                 If(
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;gt;= 0.8
                     AND
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;lt;= 1.2
                    ,1
                    ,0
                   )
                 , CompanyID
                )
           )

       ,
        // Nb of Business Plans correctly estimated
        Sum(
            Aggr(
                 If(
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;gt;= 0.8
                     AND
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_QuarterlyInvoice_Amount
                        )
                     /
                     Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(YearStart([_MonthYear]))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}
                                  &amp;gt;} BPL_BusinessPlan_QuarterlyAmount
                        )
                     &amp;lt;= 1.2
                    ,1
                    ,0
                   )
                 , CompanyID
                )
           )
      )&lt;BR /&gt;(...)&lt;/PRE&gt;&lt;P&gt;where PeriodSelect is an island table in my script and is used in a filter pane.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in this case, only the first case of my ValueList is considered (so only one bar is drawn). If I change the order of values within the ValueList, another bar is drawn (corresponding to the new first value of my ValueList)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's really weird and I don't know what is the best approach. In addition every change a long time before being displayed.&lt;BR /&gt;And unfortunately it will be quite difficult to sent an exemple here.&lt;/P&gt;&lt;P&gt;Do you understand what is happening here and what to do?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:50:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531072#M38218</guid>
      <dc:creator>fvarlet</dc:creator>
      <dc:date>2024-11-16T06:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531081#M38219</link>
      <description>&lt;P&gt;You can read here why Aggr() and Synthetic dimension (ValueList) don't work together&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.naturalsynergies.com/q-tip-14-aggr-and-synthetic-dimensions/" target="_blank"&gt;Aggr and Synthetic Dimensions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 14:45:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531081#M38219</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-16T14:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531562#M38269</link>
      <description>&lt;P&gt;Thank you very much, your link has helped me a lot to understand why that can not work. It remains a weird effect but I've found a way to avoid it, and even to improve it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've decided to change the Aggr into a set analysis. The only way I've found to make it work is to write the set analysis in a single line:&lt;/P&gt;&lt;PRE&gt;Count(Distinct
      {&amp;lt;CompanyID={'=Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}&amp;gt;} BPL_QuarterlyInvoice_Amount)/Sum(DISTINCT {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1))) &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}&amp;gt;} BPL_BusinessPlan_QuarterlyAmount)&amp;gt; 1.2'}
      &amp;gt;} CompanyID
     )&lt;/PRE&gt;&lt;P&gt;It works but the code is not easily readable.&lt;/P&gt;&lt;P&gt;How can I include end of lines within the set analysis without modifying the result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:18:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531562#M38269</guid>
      <dc:creator>fvarlet</dc:creator>
      <dc:date>2019-01-17T13:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531565#M38271</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/11714"&gt;@fvarlet&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I include end of lines within the set analysis without modifying the result?&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Include end of lines? What does that mean?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531565#M38271</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-17T13:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531576#M38273</link>
      <description>&lt;P&gt;I want to write the set analysis is several lines, like:&lt;/P&gt;&lt;PRE&gt;Count(Distinct
      {&amp;lt;CRDID={'=Sum(DISTINCT&lt;BR /&gt;                     {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1)))&lt;BR /&gt;                                             &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}&lt;BR /&gt;                     &amp;gt;} BPL_QuarterlyInvoice_Amount)&lt;BR /&gt;                 /&lt;BR /&gt;                 Sum(DISTINCT&lt;BR /&gt;                     {&amp;lt;MonthlyInvoice_Date={"&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1)))&lt;BR /&gt;                                             &amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))"}&lt;BR /&gt;                     &amp;gt;} BPL_BusinessPlan_QuarterlyAmount)&lt;BR /&gt;                 &amp;gt; 1.2'}
      &amp;gt;} CRDID
     )&lt;/PRE&gt;&lt;P&gt;But this code doesn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:24:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531576#M38273</guid>
      <dc:creator>fvarlet</dc:creator>
      <dc:date>2019-01-17T13:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531584#M38276</link>
      <description>&lt;P&gt;I think breaking the set analysis might be causing this... try this (with some additional tweaks)&lt;/P&gt;&lt;PRE&gt;Count(Distinct
      {&amp;lt;CRDID={&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;=Sum(DISTINCT
                     {&amp;lt;&lt;BR /&gt;                       MonthlyInvoice_Date={&lt;FONT color="#FF0000"&gt;[&lt;/FONT&gt;&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1)))&amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))&lt;FONT color="#FF0000"&gt;]&lt;/FONT&gt;}
                     &amp;gt;} BPL_QuarterlyInvoice_Amount)
                 /
                 Sum(DISTINCT
                     {&amp;lt;&lt;BR /&gt;                       MonthlyInvoice_Date={&lt;FONT color="#FF0000"&gt;[&lt;/FONT&gt;&amp;gt;=$(=Num(QuarterStart([_MonthYear],-1)))&amp;lt;=$(=Num(QuarterEnd([_MonthYear],-1)))&lt;FONT color="#FF0000"&gt;]&lt;/FONT&gt;}
                     &amp;gt;} BPL_BusinessPlan_QuarterlyAmount)
                 &amp;gt; 1.2&lt;FONT color="#FF0000"&gt;"&lt;/FONT&gt;}
      &amp;gt;} CRDID
     )&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531584#M38276</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-17T13:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531597#M38279</link>
      <description>&lt;P&gt;It works, thanks a lot &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://community.qlik.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;I tried with simple quotes instead of squared braquets, but that didn't work.&lt;BR /&gt;Unfortunately Qlik Sense doesn't detect my closing braquets and closing double quotes anymore, so I have to check very carefully I haven't forgotten any closing braquets/double quotes/..., but the code is quite easy to maintain now.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:42:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531597#M38279</guid>
      <dc:creator>fvarlet</dc:creator>
      <dc:date>2019-01-17T13:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Barchart and valuelist</title>
      <link>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531601#M38280</link>
      <description>&lt;P&gt;Super, I am glad you were able to resolve your issue.&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Sunny&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Barchart-and-valuelist/m-p/1531601#M38280</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-17T13:47:42Z</dc:date>
    </item>
  </channel>
</rss>

