<?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 If condition with only() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911612#M984938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a problem with Rolling 12 months bar chart. I want the chart to show the avg for each month(for 12 month from the month selected). And default to the latest month for which the data is available(If no month/year is selected). The following is my expression :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;If(GetSelectedCount([Month ])=0 and GetSelectedCount([Year ])=0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Only({$&amp;lt;MonthYearID={"&amp;lt;= $(=$(vMax)) &amp;gt;= $(=$(vMax)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} &amp;gt;}R_AvgCardSwipes),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Only({$&amp;lt;MonthYearID={"&amp;lt;= $(=max(MonthYearID)) &amp;gt;= $(=max(MonthYearID)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} &amp;gt;}R_AvgCardSwipes))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Only() expressions works fine when alone but not when used with the if condition.&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Aug 2015 10:00:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-08-05T10:00:36Z</dc:date>
    <item>
      <title>If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911612#M984938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a problem with Rolling 12 months bar chart. I want the chart to show the avg for each month(for 12 month from the month selected). And default to the latest month for which the data is available(If no month/year is selected). The following is my expression :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;If(GetSelectedCount([Month ])=0 and GetSelectedCount([Year ])=0,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Only({$&amp;lt;MonthYearID={"&amp;lt;= $(=$(vMax)) &amp;gt;= $(=$(vMax)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} &amp;gt;}R_AvgCardSwipes),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Only({$&amp;lt;MonthYearID={"&amp;lt;= $(=max(MonthYearID)) &amp;gt;= $(=max(MonthYearID)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} &amp;gt;}R_AvgCardSwipes))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Only() expressions works fine when alone but not when used with the if condition.&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911612#M984938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T10:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911613#M984940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both Only expressions work stand alone? and both don't work when you make and clear selection???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911613#M984940</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-05T10:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911614#M984942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Sunny. Both expressions work when alone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:21:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911614#M984942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T10:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911615#M984944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;try&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Only({$&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;Month =,Year=,&lt;/STRONG&gt;&lt;/SPAN&gt;MonthYearID={"&amp;lt;= $(=$(vMax)) &amp;gt;= $(=$(vMax)-11)"},Location = {$(=SubField(GetfieldSelections(Location),':',-1))} &amp;gt;}R_AvgCardSwipes),&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911615#M984944</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2015-08-05T10:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911616#M984946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But there is no change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:42:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911616#M984946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T10:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911617#M984948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the problem that it isn't giving you the result you expect or its just not giving any result???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:43:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911617#M984948</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-05T10:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911618#M984950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what I can interpret, Values get passed to variables in both the expressions. Both expressions are selected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:50:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911618#M984950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T10:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911619#M984952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well even if the value goes to both the expression, only one of the if statement clauses are going to be true. So either 1st expression or the 2nd expression is going to be evaluated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens when you replace Only() with Avg(), May be there are more than one value to be displayed and Only just isn't possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 10:53:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911619#M984952</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-05T10:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911620#M984954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny. But the values are wrong .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a work around. Instead of the if condition, I am using two charts with conditional hiding - One when no selection and other when there is a selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 11:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911620#M984954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T11:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911621#M984956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May I suggest two expressions, instead of two charts? and conditionally hiding/showing them based on your condition. Just one less chart to worry about &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&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>Wed, 05 Aug 2015 11:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911621#M984956</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-05T11:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911622#M984958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes Sure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2015 11:22:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911622#M984958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-05T11:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: If condition with only()</title>
      <link>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911623#M984960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you got what you were looking for, I would suggest closing this thread by selecting a correct answer and any helpful answers.&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>Wed, 05 Aug 2015 11:26:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-condition-with-only/m-p/911623#M984960</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-05T11:26:31Z</dc:date>
    </item>
  </channel>
</rss>

