<?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. :If statement issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193734#M54885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;your answer is working fine, but there is a new issue, which i am not able to solve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my previous post says (9/ (&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S1&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*2)) + (7/(&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S2&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but now i want some thing like this, (9+7) / Count(if(Stage='S1', DocID)*2, if(Stage='S2', DocID)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my scenario if you dont understand my question.&lt;/P&gt;&lt;P&gt;In S1 i have 100 docs with 2 probabilities, in S2 i have 100 docs with 3 probabilities. My whole idea is to calculate the error rate in such stages.&lt;/P&gt;&lt;P&gt;so in Stage1 total number of error is 9, therefore ------------------ 9/(Count of DocID *Probability)&lt;/P&gt;&lt;P&gt;In Stage2 total number of error is 7, therefore ------------------- 7/(Count of DocID*Probability)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a list box Stages, it has S1 and S2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S1 qlikview should calculate - &lt;STRONG&gt;9/(100*2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S2 qlikview should calculate - &lt;STRONG&gt;7/(100*3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S1&amp;amp;S1 qlikview shoudl calculate - &lt;STRONG&gt;(9+7)/(200+300)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please help me in this scenario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2011 07:01:57 GMT</pubDate>
    <dc:creator>renjithpl</dc:creator>
    <dc:date>2011-02-01T07:01:57Z</dc:date>
    <item>
      <title>If statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193730#M54881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Look at the below formula, its not giving an answer, Please help me in finding the error,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;=(9 /(&lt;B&gt;count&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Stage&lt;/B&gt;='S1', &lt;B&gt;DocID&lt;/B&gt;))*2)) + (7/(&lt;B&gt;count&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Stage&lt;/B&gt;='S2', &lt;B&gt;DocID&lt;/B&gt;))*3))&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;THe condition is, when stage =S1 the count of DocID * 2 and the result should be divided with 9&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;and when Stage=S2 the count of DocID * 3 and the result should be divided with 7.&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Regards&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt; line-height: normal; mso-layout-grid-align: none;"&gt;Ren&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 10:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193730#M54881</guid>
      <dc:creator>renjithpl</dc:creator>
      <dc:date>2011-01-31T10:02:23Z</dc:date>
    </item>
    <item>
      <title>Re. :If statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193731#M54882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;You can try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=9 /(&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={S1}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*2) + 7/(&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={S2}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*3)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 10:13:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193731#M54882</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2011-01-31T10:13:50Z</dc:date>
    </item>
    <item>
      <title>If statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193732#M54883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ranjit&lt;/P&gt;&lt;P&gt;Your description and formula are not the same. I understand that may be just language issue - but in case not...&lt;/P&gt;&lt;P&gt;The problem may be due to the division - if one of the counts is zero, you will be attempting to divide by zero, which is undefined and therefore no answer. Perhaps your formula should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;line-height:normal;"&gt;=&lt;B&gt;count&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Stage&lt;/B&gt;='S1', &lt;B&gt;DocID&lt;/B&gt;))*2/9 + &lt;B&gt;count&lt;/B&gt;(&lt;B&gt;if&lt;/B&gt;(&lt;B&gt;Stage&lt;/B&gt;='S2', &lt;B&gt;DocID&lt;/B&gt;))*3/7&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;line-height:normal;"&gt;You could also convert it to a set expression as in Martin's post - unless this is in a chart/table with Stage as one of the dimensions.&lt;/P&gt;&lt;P style="margin:0in 0in 0pt;line-height:normal;"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 11:05:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193732#M54883</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-01-31T11:05:48Z</dc:date>
    </item>
    <item>
      <title>If statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193733#M54884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;thanks for the reply, i have used Martins answer and its working fine, but now there is a change in my formula.&lt;/P&gt;&lt;P&gt;Can you help me in figuring out this issue,&lt;/P&gt;&lt;P&gt;my previous post says (9/ (&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S1&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*2)) + (7/(&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S2&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but now i want some thing like this, (9+7) / Count(if(Stage='S1', DocID)*2, if(Stage='S2', DocID)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my scenario if you dont understand my question.&lt;/P&gt;&lt;P&gt;in S1 i have 100 docs with 2 probabilities, in S2 i have 100 docs with 3 probabilities. My whole idea is to calculate the error rate in such stages.&lt;/P&gt;&lt;P&gt;so in Stage1 total number of error is 9, therefore ------------------ 9/(Count of DocID *Probability)&lt;/P&gt;&lt;P&gt;in Stage2 total number of error is 7, therefore ------------------- 7/(Count of DocID*Probability)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a list box Stages, it has S1 and S2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if i select S1 qlikview should calculate - &lt;STRONG&gt;9/(100*2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if i select S2 qlikview should calculate - &lt;STRONG&gt;7/(100*3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if i select S1&amp;amp;S1 qlikview shoudl calculate - &lt;STRONG&gt;(9+7)/(200+300)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please help me in this scenario.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 06:56:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193733#M54884</guid>
      <dc:creator>renjithpl</dc:creator>
      <dc:date>2011-02-01T06:56:09Z</dc:date>
    </item>
    <item>
      <title>Re. :If statement issue</title>
      <link>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193734#M54885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;your answer is working fine, but there is a new issue, which i am not able to solve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my previous post says (9/ (&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S1&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*2)) + (7/(&lt;B&gt;count&lt;/B&gt;({&amp;lt;&lt;B&gt;Stage&lt;/B&gt;={&lt;B&gt;S2&lt;/B&gt;}&amp;gt;} &lt;B&gt;DocID&lt;/B&gt;)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but now i want some thing like this, (9+7) / Count(if(Stage='S1', DocID)*2, if(Stage='S2', DocID)*3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my scenario if you dont understand my question.&lt;/P&gt;&lt;P&gt;In S1 i have 100 docs with 2 probabilities, in S2 i have 100 docs with 3 probabilities. My whole idea is to calculate the error rate in such stages.&lt;/P&gt;&lt;P&gt;so in Stage1 total number of error is 9, therefore ------------------ 9/(Count of DocID *Probability)&lt;/P&gt;&lt;P&gt;In Stage2 total number of error is 7, therefore ------------------- 7/(Count of DocID*Probability)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a list box Stages, it has S1 and S2.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S1 qlikview should calculate - &lt;STRONG&gt;9/(100*2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S2 qlikview should calculate - &lt;STRONG&gt;7/(100*3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i select S1&amp;amp;S1 qlikview shoudl calculate - &lt;STRONG&gt;(9+7)/(200+300)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please help me in this scenario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 07:01:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-statement-issue/m-p/193734#M54885</guid>
      <dc:creator>renjithpl</dc:creator>
      <dc:date>2011-02-01T07:01:57Z</dc:date>
    </item>
  </channel>
</rss>

