<?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 Simple Expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339234#M1171722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Looks like I have a next path for learning!&amp;nbsp; Thanks Jagan.&amp;nbsp; I will try to get some time next week to re-do the example without all of the if statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jun 2012 14:23:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-06-07T14:23:15Z</dc:date>
    <item>
      <title>Simple Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339232#M1171720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, this is not really a question unless you wish to add to the thread.&amp;nbsp; I am marking it as a question so that I can give points to cool additions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was finding that expression writing was not coming as naturally to me as I would like so I spent some time writing out a bunch of simple expressions that control whether a graph is:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Showing absolute values or relative values&lt;/LI&gt;&lt;LI&gt;Is showing the first value from a data set, the last value from a data set, or all data in the selected data set.&lt;/LI&gt;&lt;LI&gt;For fun, I added a little expression to show both the first data and the last data side by side.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could totally see adding another set of formulas that work for the ENTIRE data set regardless of the date selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attaching a QVW file but I am also listing the text here for those that only have the free version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enjoy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// | My data set has a DATE, STORE, INVENTORY&lt;BR /&gt;// | The date is the date that the inventory level was captured&lt;BR /&gt;// | The store is the store location of the inventory&lt;BR /&gt;// | The inventory is the number of items counted in inventory&lt;BR /&gt;// |&lt;BR /&gt;// | The following attempt to look at all of the "simple" expressions&lt;BR /&gt;// | that can be used to look at this data in a chart&lt;BR /&gt;// |&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// ABSOLUTE DATA values for EACH DATE within SELECTED DATE RANGE &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM([Inventory])&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// ABSOLUTE DATA values for LAST DATE within SELECTED DATE RANGE &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=max(total [Date]),[Inventory],0))&lt;BR /&gt;//&lt;BR /&gt;// -------------------------------------------------------------------------&lt;BR /&gt;// ABSOLUTE DATA values for FIRST DATE within SELECTED DATE RANGE &lt;BR /&gt;// -------------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=min(total [Date]),[Inventory],0))&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// RELATIVE DATA values for EACH DATE within SELECTED DATE RANGE &lt;BR /&gt;// RELATIVE TO THE ENTIRE TIME PERIOD&lt;BR /&gt;// Not really applicable to this story but since I did it, I thought &lt;BR /&gt;// that I would keep it here.&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM ([Inventory]) / SUM ( total [Inventory])&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// RELATIVE DATA values for EACH DATE within SELECTED DATE RANGE &lt;BR /&gt;// RELATIVE to EACH SPECIFIC DATE (normalizes ratios) &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM ([Inventory]) / SUM ( total &amp;lt;[Date]&amp;gt; [Inventory])&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// RELATIVE DATA values for LAST DATE within SELECTED DATE RANGE &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=max(total [Date]),[Inventory],0)) / SUM ( total &amp;lt;[Date]&amp;gt; if([Date]=max(total [Date]),[Inventory],0))&lt;BR /&gt;// &lt;BR /&gt;// -------------------------------------------------------------------------&lt;BR /&gt;// RELATIVE DATA values for FIRST DATE within SELECTED DATE RANGE &lt;BR /&gt;// -------------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=min(total [Date]),[Inventory],0)) / SUM ( total &amp;lt;[Date]&amp;gt; if([Date]=min(total [Date]),[Inventory],0))&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// ** ** ** ** ** Now some really fun stuff ** ** ** ** **&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// ABSOLUTE DATA values for FIRST DATE within SELECTED DATE RANGE &lt;BR /&gt;// COMPARED TO the LAST DATE within SELECTED DATE RANGE &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=min(total [Date]),[Inventory],if([Date]=max(total [Date]),[Inventory],0)))&lt;BR /&gt;//&lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// RELATIVE DATA values for FIRST DATE within SELECTED DATE RANGE &lt;BR /&gt;// COMPARED TO the LAST DATE within SELECTED DATE RANGE &lt;BR /&gt;// ----------------------------------------------------------------------&lt;BR /&gt;// SUM (if([Date]=min(total [Date]),[Inventory],if([Date]=max(total [Date]),[Inventory],0))) / SUM ( total &amp;lt;[Date]&amp;gt; if([Date]=min(total [Date]),[Inventory],if([Date]=max(total [Date]),[Inventory],0)))&lt;BR /&gt;//&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2012 20:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339232#M1171720</guid>
      <dc:creator />
      <dc:date>2012-06-05T20:49:25Z</dc:date>
    </item>
    <item>
      <title>Simple Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339233#M1171721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use set analysis for the below expressions, using if in set analysis is not suggestible because of performance issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// ABSOLUTE DATA values for LAST DATE within SELECTED DATE RANGE &lt;/P&gt;&lt;P&gt;// ----------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;// SUM (if([Date]=max(total [Date]),[Inventory],0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can rewrite this expression as, it purely uses Set Analysis, so the performance is better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =SUM ({&amp;lt;[Date]={'=$(=max(total [Date]))'}&amp;gt;} [Inventory])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;// -------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;// ABSOLUTE DATA values for FIRST DATE within SELECTED DATE RANGE &lt;/P&gt;&lt;P&gt;// -------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;// SUM (if([Date]=min(total [Date]),[Inventory],0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can rewrite this expression as, it purely uses Set Analysis, so the performance is better&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =SUM ({&amp;lt;[Date]={'=$(=min(total [Date]))'}&amp;gt;} [Inventory])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 13:27:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339233#M1171721</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-06-06T13:27:12Z</dc:date>
    </item>
    <item>
      <title>Simple Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339234#M1171722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Looks like I have a next path for learning!&amp;nbsp; Thanks Jagan.&amp;nbsp; I will try to get some time next week to re-do the example without all of the if statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 14:23:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339234#M1171722</guid>
      <dc:creator />
      <dc:date>2012-06-07T14:23:15Z</dc:date>
    </item>
    <item>
      <title>Simple Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339235#M1171723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this tool really interesting / fun for playing around with set analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa="&gt;http://tools.qlikblog.at/SetAnalysisWizard/QlikView-SetAnalysis_Wizard_and_Generator.aspx?sa=&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a quick and easy tool you can use to create some complex set analysis with!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2012 16:08:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339235#M1171723</guid>
      <dc:creator>oxtontom</dc:creator>
      <dc:date>2012-06-07T16:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339236#M1171724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope attached file helps you to optimize qlikview charts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 19:16:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-Expressions/m-p/339236#M1171724</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-06-08T19:16:43Z</dc:date>
    </item>
  </channel>
</rss>

