<?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: Problem with expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283494#M869940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is this not working then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;Month, Quarter, Week, Day, DayNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;}&lt;/SPAN&gt; Aggr(If(Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) - (0.0625 * Count(DISTINCT Sale_DateM)) / (Count(DISTINCT Sale_DateM) * 0.270833333)) &amp;lt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) / (Count(DISTINCT Sale_DateM) * 0.270833333),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;STRONG&gt;Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) - (0.0625 * Count(DISTINCT Sale_DateM)) / (Count(DISTINCT Sale_DateM) * 0.270833333))), Day))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Dec 2016 20:38:33 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-05T20:38:33Z</dc:date>
    <item>
      <title>Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283491#M869936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good evening,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am experiencing a slight problem with expressions,I am trying to calculate the average of this expression using set analysis and the dimension = Day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(((Sum (TimeBetweenLeadsFinal)-(0.0625*count(distinct Sale_DateM)))/(count(distinct Sale_DateM)*0.270833333))&amp;lt;0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; ((Sum (TimeBetweenLeadsFinal)))/(count(distinct Sale_DateM)*0.270833333),&lt;/P&gt;&lt;P&gt;&amp;nbsp; ((Sum (TimeBetweenLeadsFinal)-(0.0625*count(distinct Sale_DateM)))/(count(distinct Sale_DateM)*0.270833333)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283491#M869936</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283492#M869938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(Aggr(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;if(((Sum (TimeBetweenLeadsFinal)-(0.0625*count(distinct Sale_DateM)))/(count(distinct Sale_DateM)*0.270833333))&amp;lt;0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; ((Sum (TimeBetweenLeadsFinal)))/(count(distinct Sale_DateM)*0.270833333),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp; ((Sum (TimeBetweenLeadsFinal)-(0.0625*count(distinct Sale_DateM)))/(count(distinct Sale_DateM)*0.270833333)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;, Day))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:10:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283492#M869938</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-05T20:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283493#M869939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the expression you gave is correct but I forgot to mention that I need to calculate Month To Date(MTD), the expression I am looking for is probably like this below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Avg(Aggr(if(sum({&amp;lt;Month=, Quarter=, Week=, Day, DateNum={"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;}TimeBetweenLeadsFinal)- (0.0625*count(distinct Sale_DateM))/(count(distinct Sale_DateM)*0.270833333))&amp;lt;0,&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;sum({&amp;lt;Month=, Quarter=, Week=, Day, DateNum={"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;}TimeBetweenLeadsFinal)/(count(distinct Sale_DateM)*0.270833333),&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;sum({&amp;lt;Month=, Quarter=, Week=, Day, DateNum={"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;}TimeBetweenLeadsFinal)-(0.0625*count(distinct Sale_DateM))/(count(distinct Sale_DateM)*0.270833333))),Day))&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:34:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283493#M869939</guid>
      <dc:creator />
      <dc:date>2016-12-05T20:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283494#M869940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is this not working then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg(&lt;SPAN style="color: #ff0000;"&gt;{&amp;lt;Month, Quarter, Week, Day, DayNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;}&lt;/SPAN&gt; Aggr(If(Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) - (0.0625 * Count(DISTINCT Sale_DateM)) / (Count(DISTINCT Sale_DateM) * 0.270833333)) &amp;lt; 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) / (Count(DISTINCT Sale_DateM) * 0.270833333),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;&lt;STRONG&gt;Sum({&amp;lt;Month, Quarter, Week, Day, DateNum = {"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"}&amp;gt;} TimeBetweenLeadsFinal) - (0.0625 * Count(DISTINCT Sale_DateM)) / (Count(DISTINCT Sale_DateM) * 0.270833333))), Day))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:38:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283494#M869940</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-05T20:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283495#M869941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So what I am trying to achieve is something like the graph below, where I need to calculate Averages of the following expressions:&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;PreviewedFirst={1}&amp;gt;}PreviewTime)/sum(timespent) (&lt;STRONG&gt; to Calculate Average of % Preview&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Sum(CallTime)/&lt;SPAN style="font-size: 13.3333px;"&gt;sum(timespent)&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;( &lt;STRONG&gt;to Calculate Average of %CallTime)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum(WraptimeLastCall)/&lt;SPAN style="font-size: 13.3333px;"&gt;sum(timespent) &lt;SPAN style="font-size: 13.3333px;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;( &lt;STRONG&gt;to Calculate Average of %WrapTime) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Sum (TimeBetweenLeadsFinal)-(0.0625*count(distinct(LTheDate)))/&lt;SPAN style="font-size: 13.3333px;"&gt;sum(timespent)&amp;nbsp; (&lt;STRONG style="font-size: 13.3333px;"&gt;to Calculate Average of %TimeBetweenLeads)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sum(timespent)/(count(distinct Sale_DateM)*0.270833333) (&lt;STRONG&gt;to calculate Average of % utilisatio&lt;/STRONG&gt;n)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I use&amp;nbsp; Month=, Quarter=, Week=, Day, DateNum={"&amp;gt;=$(=Num(MonthStart(Max(DateNum))))&amp;lt;=$(=Max(DateNum))"} to calculate MTD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sample Data.PNG" class="jive-image image-1" src="/legacyfs/online/145686_Sample Data.PNG" style="height: 240px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 20:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283495#M869941</guid>
      <dc:creator />
      <dc:date>2016-12-05T20:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with expression</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283496#M869942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you want is always good to see, but it becomes very difficult to suggest anything in a complicated expression such as yours without a sample. Would you be able to share a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2016 21:02:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-expression/m-p/1283496#M869942</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-05T21:02:22Z</dc:date>
    </item>
  </channel>
</rss>

