<?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 Help with Nested If Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93744#M457782</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel like this is one of those moments where it's something simple and I just can't see it. Hoping someone can tell me what I'm doing wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a few charts to show Top &amp;amp; Bottom 5, depending on the values of two variables.&amp;nbsp; All charts work, except for one.&amp;nbsp; The 1st two If's are the ones I need in this chart and they work if I just use them, or if I just use them and add If(1=1,'Yes'))) at the end.&amp;nbsp; In other words, the expression stops at the 2nd row.&amp;nbsp; But, when the rest of the nested If's are used, it says that there is no data to be displayed.&amp;nbsp; Seems like it doesn't stop at the 2nd row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the variables:&lt;/P&gt;&lt;P&gt;vCallsExpressions: Contains the Metric to be viewed&lt;/P&gt;&lt;P&gt;vWGTopBottom: WorkGroup Top Bottom.&amp;nbsp; Contains 0 for Top 5, 1 for Bottom 5.&amp;nbsp; Value is set via trigger in buttons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variables are set as vCallsExpression: Calls Offered and vWGTopBottom: 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 0,Num(If(Rank( sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 1,Num(If(Rank(-sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 0,Interval(If(Rank(-sum(AHTime) / sum(ACDCalls)) &amp;lt;= 5,sum(AHTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 1,Interval(If(Rank( sum(AHTime) / sum(ACDCalls)) &amp;lt;= 5,sum(AHTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Hold' and vWGTopBottom = 0,Interval(If(Rank(-sum(HoldTime) / sum(ACDCalls)) &amp;lt;= 5,sum(HoldTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Hold' and vWGTopBottom = 1,Interval(If(Rank( sum(HoldTime) / sum(ACDCalls)) &amp;lt;= 5,sum(HoldTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'ACW' and vWGTopBottom = 0,Interval(If(Rank(-(sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls)) &amp;lt;= 5,sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'ACW' and vWGTopBottom = 1,Interval(If(Rank(( sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls)) &amp;lt;= 5,sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls),'h:mm:ss')))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any/all help.&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2018 14:21:04 GMT</pubDate>
    <dc:creator>jcampbell474</dc:creator>
    <dc:date>2018-08-16T14:21:04Z</dc:date>
    <item>
      <title>Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93744#M457782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I feel like this is one of those moments where it's something simple and I just can't see it. Hoping someone can tell me what I'm doing wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a few charts to show Top &amp;amp; Bottom 5, depending on the values of two variables.&amp;nbsp; All charts work, except for one.&amp;nbsp; The 1st two If's are the ones I need in this chart and they work if I just use them, or if I just use them and add If(1=1,'Yes'))) at the end.&amp;nbsp; In other words, the expression stops at the 2nd row.&amp;nbsp; But, when the rest of the nested If's are used, it says that there is no data to be displayed.&amp;nbsp; Seems like it doesn't stop at the 2nd row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the variables:&lt;/P&gt;&lt;P&gt;vCallsExpressions: Contains the Metric to be viewed&lt;/P&gt;&lt;P&gt;vWGTopBottom: WorkGroup Top Bottom.&amp;nbsp; Contains 0 for Top 5, 1 for Bottom 5.&amp;nbsp; Value is set via trigger in buttons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variables are set as vCallsExpression: Calls Offered and vWGTopBottom: 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 0,Num(If(Rank( sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 1,Num(If(Rank(-sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 0,Interval(If(Rank(-sum(AHTime) / sum(ACDCalls)) &amp;lt;= 5,sum(AHTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 1,Interval(If(Rank( sum(AHTime) / sum(ACDCalls)) &amp;lt;= 5,sum(AHTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Hold' and vWGTopBottom = 0,Interval(If(Rank(-sum(HoldTime) / sum(ACDCalls)) &amp;lt;= 5,sum(HoldTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Hold' and vWGTopBottom = 1,Interval(If(Rank( sum(HoldTime) / sum(ACDCalls)) &amp;lt;= 5,sum(HoldTime) / sum(ACDCalls)),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'ACW' and vWGTopBottom = 0,Interval(If(Rank(-(sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls)) &amp;lt;= 5,sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls),'h:mm:ss'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'ACW' and vWGTopBottom = 1,Interval(If(Rank(( sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls)) &amp;lt;= 5,sum({&amp;lt;AUXcode = {'Extended Acw'}&amp;gt;} Duration) + sum(ACWTime)) / sum(ACDCalls),'h:mm:ss')))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any/all help.&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 14:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93744#M457782</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2018-08-16T14:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93745#M457783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression looks okay.&lt;/P&gt;&lt;P&gt;Please check if your data has correct formatting and also try adding else part in the last IF statement after Interval() and see if you get a default output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:05:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93745#M457783</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T15:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93746#M457784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Vamsee.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been looking at it more and narrowed it down to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works.&amp;nbsp; Notice, the last If statement simply returns 'yes'.&amp;nbsp; It actually stops at the 2nd If when vWGTopBottom = 1 and stops at the 1st when vWGTopBottom = 0.&amp;nbsp; Works fine.&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 0,Num(If(Rank( sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 1,Num(If(Rank(-sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 0,'yes')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This doesn't work.&amp;nbsp; Notice that the last statement returns sum(ACDCalls), else 0.&amp;nbsp; The entire object will not populate when an expression is in the 3rd If statement.&amp;nbsp; It will not work even if I remove the variables and simply put If(1=1,sum(ACDCalls)).&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 0,Num(If(Rank( sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'Calls Offered' and vWGTopBottom = 1,Num(If(Rank(-sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)) &amp;lt;= 5, sum({&amp;lt;ACDCalls = {"&amp;gt;0"}&amp;gt;} ACDCalls)),'#,##0'),&lt;/P&gt;&lt;P&gt;If(vCallsExpression = 'AHT' and vWGTopBottom = 0,sum(ACDCalls),0)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is causing this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93746#M457784</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2018-08-16T15:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93747#M457785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please share your sample QVW. It might be an issue with your data types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coz I have generated some random numbers and checked your expression and it worked for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 15:25:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93747#M457785</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T15:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93748#M457786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a sample.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Toggle using the Top and Bottom buttons.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 16:31:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93748#M457786</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2018-08-16T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93749#M457787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added Aggr(, WorkGroup) to your third expression. (p.s: middle chart).&lt;/P&gt;&lt;P&gt;Looks like it worked. Please check.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And also to test out I have added another text box which initializes the variable &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;vWGTopBottom=2 to test the third if statement and it worked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Please check.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 17:26:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93749#M457787</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T17:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93750#M457788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vamsee, that's it!&amp;nbsp; Thank you!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never thought AGGR would be the solution.&amp;nbsp; Why did it work?&amp;nbsp; Set analysis did not remove the aggregation (Workgroup is a dimension).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 17:44:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93750#M457788</guid>
      <dc:creator>jcampbell474</dc:creator>
      <dc:date>2018-08-16T17:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Nested If Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93751#M457789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to hear it worked.&lt;/P&gt;&lt;P&gt;No Set didn't remove it. The IF statements did.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(IF(Conditions, SUM(), NULL() )) would also do the trick in some situations. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 18:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-Nested-If-Expression/m-p/93751#M457789</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-16T18:26:07Z</dc:date>
    </item>
  </channel>
</rss>

