<?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: How to solve this using IF Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74320#M458316</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My apologies Sunny. you solved it the first time as always with your midas touch man. I was not thinking straight and missed a bracket &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/plain.png" /&gt;&amp;nbsp; Thank you so much. have a wonderful weekend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Apr 2018 03:51:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-08T03:51:34Z</dc:date>
    <item>
      <title>How to solve this using IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74316#M458312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem that might be fixed by a proper IF statement. Hoping you experts might be able to help me out. &lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have 3 products A B &amp;amp; C. During month(now) which is april, I want to forecast my sales for B&amp;amp;C but not A. for the past months, there is no need to forecast so you will see actual sales volume same as forecasted sales volume in the sample table. &lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;What I have so far:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To make the espression work on front end with ease, I created a flag field in the script:- if (monthstart([Sales Month]) = monthstart(today()) and Product &amp;lt;&amp;gt; ‘A’, ‘Flag’, ‘No_Forcast’) as Flag_Field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Times New Roman',serif; color: black;"&gt;I am using this calculated field in the expression in the bar chart.&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Flag_Field&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;='Flag',(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum([&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Actual SalesVolume])&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;/&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;VNo_days&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;VTotal_days&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum([&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;ActualSales Volume]&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the problem is unless I select a single product, either A, B, or C the month(now) metric value does not show correct result. If I select A and B, the metric shown is the actual volume, it does not take into account the forecasted volume.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Problem defined again&lt;/STRONG&gt; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;when product field is not selected, Result shown = (20000+8000+3000) = 31000. Result expected =(20000+40000+15000) = 75000&lt;/P&gt;&lt;P&gt;when a single product is selected, for eg B, it will correctly show 40000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="CB_rate_diff.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198819_CB_rate_diff.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;shout out to &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌ sunny you dont have to solve this if it requires hard work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; but just wanted to thank you for your help in the past. best. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 02:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74316#M458312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-08T02:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve this using IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74317#M458313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;How about this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;RangeSum(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Sum({&amp;lt;Flag_Field = {'Flag'}&amp;gt;}[Actual SalesVolume])/VNo_days)*VTotal_days,&lt;/STRONG&gt;&lt;/SPAN&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 style="font-family: arial, helvetica, sans-serif;"&gt;Sum({&amp;lt;Flag_Field = {'No_Forcast'}&amp;gt;} ActualSales Volume]))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 02:55:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74317#M458313</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-08T02:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve this using IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74318#M458314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its actually a ratio that I am measuring. so in the previous formual i added /sum(Totalcost) to measure a ratio which will make the expression as below. and rangesum do not seem to work.&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;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Flag_Field&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;='Flag',((&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;sum([&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;Actual SalesVolume])&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;/&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;VNo_days&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)*&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;VTotal_days)/sum(&lt;/EM&gt;Totalcost&lt;EM style="font-weight: inherit; font-size: 9pt; font-family: 'Courier New'; color: gray;"&gt;)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;sum([&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;ActualSales Volume]/sum(Totalcost&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;I left the problem to have only sum to simplify the problem, now I may have made it complex. sorry about that. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/plain.png" /&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 03:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74318#M458314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-08T03:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve this using IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74319#M458315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be just this&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;SPAN style="font-weight: inherit; font-style: inherit; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;RangeSum(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Sum({&amp;lt;Flag_Field = {'Flag'}&amp;gt;}[Actual SalesVolume])/VNo_days)*VTotal_days,&lt;/STRONG&gt;&lt;/SPAN&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 style="font-style: inherit; font-family: arial, helvetica, sans-serif;"&gt;Sum({&amp;lt;Flag_Field = {'No_Forcast'}&amp;gt;} ActualSales Volume]))&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 style="font-style: inherit; font-family: arial, helvetica, sans-serif;"&gt;/&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 style="font-style: inherit; font-family: arial, helvetica, sans-serif;"&gt;Sum([Totalcost])&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 03:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74319#M458315</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-08T03:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to solve this using IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74320#M458316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My apologies Sunny. you solved it the first time as always with your midas touch man. I was not thinking straight and missed a bracket &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/plain.png" /&gt;&amp;nbsp; Thank you so much. have a wonderful weekend.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Apr 2018 03:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-solve-this-using-IF-Statement/m-p/74320#M458316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-08T03:51:34Z</dc:date>
    </item>
  </channel>
</rss>

