<?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: Conditional expression based on dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560191#M441245</link>
    <description>&lt;P&gt;did you try&lt;/P&gt;&lt;P&gt;year=max({1}year) ?&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2019 15:26:43 GMT</pubDate>
    <dc:creator>olivierrobin</dc:creator>
    <dc:date>2019-03-22T15:26:43Z</dc:date>
    <item>
      <title>Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1559526#M441163</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;There is a chart showing monthly price dynamics for two years (current &amp;amp; previous).&lt;BR /&gt;There are also two straight lines showing avg price of current year and previous year.&lt;/P&gt;&lt;P&gt;On the same sheet user can set filters by month and year, but these filters do not affect the chart. It always shows full max year from the selection + the previous one (i.e. 2019 + 2018, 2018 + 2017, etc).&lt;BR /&gt;All other selections should be applied to the chart. I.e., if user needs data of specific product or customer.&lt;/P&gt;&lt;P&gt;Is it possible to show Avg CY line only for this year, and Avg PY line only for prev.year? (see example below)&lt;/P&gt;&lt;P&gt;I tried If function "if(Year = max(Year), then)", but it makes Year &amp;amp; month selections applied:&lt;BR /&gt;If March is selected, it shows single point for March;&lt;BR /&gt;If only 2019 year is chosen, there is nothing shown for 2018.&lt;/P&gt;&lt;P&gt;Any advice on the topic is appreciated.&lt;BR /&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chart example.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/8547i33E3011B720A8313/image-size/large?v=v2&amp;amp;px=999" role="button" title="chart example.png" alt="chart example.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1559526#M441163</guid>
      <dc:creator>Konstantin_Novikov</dc:creator>
      <dc:date>2024-11-16T21:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1559596#M441176</link>
      <description>&lt;P&gt;use total keyword in your avg expression&lt;/P&gt;&lt;P&gt;like avg(total expressiondefinition)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 14:05:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1559596#M441176</guid>
      <dc:creator>anushree1</dc:creator>
      <dc:date>2019-03-21T14:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560191#M441245</link>
      <description>&lt;P&gt;did you try&lt;/P&gt;&lt;P&gt;year=max({1}year) ?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 15:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560191#M441245</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2019-03-22T15:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560775#M441282</link>
      <description>&lt;P&gt;Thank you for your answers. I got some progress using max({1}Year). Now the graph is perfect if 2019 year is chosen and there is no selection by month.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/8757i5C84405B24899A90/image-size/large?v=v2&amp;amp;px=999" role="button" title="example.png" alt="example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There are two problems now:&lt;BR /&gt;1) If 2018 is chosen, PY line disappears;&lt;BR /&gt;2) If there is a selection by month, PY line is shown for both years, and CY line is shown only for selected months&lt;/P&gt;&lt;P&gt;Current expressions are the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg CY:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If(Calendar.Year = max({1}Calendar.Year),&lt;BR /&gt;sum(TOTAL { &amp;lt; Calendar.MonthName = , Calendar.Year = {'$(=max(Calendar.Year))'} &amp;gt; }Sales)&lt;BR /&gt;/&lt;BR /&gt;sum(TOTAL { &amp;lt; Calendar.MonthName = , Calendar.Year = {'$(=max(Calendar.Year))'} &amp;gt; }Volume)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Avg PY:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If(Calendar.Year &amp;lt;&amp;gt; max({1}Calendar.Year),&lt;BR /&gt;sum(TOTAL { &amp;lt; Calendar.MonthName = , Calendar.Year = {'$(=max(Calendar.Year)-1)'} &amp;gt; }Sales)&lt;BR /&gt;/&lt;BR /&gt;sum(TOTAL { &amp;lt; Calendar.MonthName = , Calendar.Year = {'$(=max(Calendar.Year)-1)'} &amp;gt; }Volume)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:54:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560775#M441282</guid>
      <dc:creator>Konstantin_Novikov</dc:creator>
      <dc:date>2019-03-25T12:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560807#M441285</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;in your set analysis, try to add&lt;/P&gt;&lt;P&gt;Calendar.Month=&lt;/P&gt;&lt;P&gt;which will inhibit all selections made on month&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1560807#M441285</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2019-03-25T13:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional expression based on dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1561272#M441322</link>
      <description>There are two fields: Calendar.YearMonthName and Calendar.MonthName.&lt;BR /&gt;The first one is dimension on X axis, and the second one is used by users for period selection.&lt;BR /&gt;In my expressions there are already "Calendar.MonthName = " identifiers. I also tried adding "Calendar.YearMonthName = ", but both options (and combination) do not work.</description>
      <pubDate>Tue, 26 Mar 2019 11:17:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-expression-based-on-dimension/m-p/1561272#M441322</guid>
      <dc:creator>Konstantin_Novikov</dc:creator>
      <dc:date>2019-03-26T11:17:08Z</dc:date>
    </item>
  </channel>
</rss>

