<?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: Help with displaying current details in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263986#M1191448</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;What I mean is that in the original expression, you were using "SalesQuantity" at the end of the expression. That shows only the value of that field for the aggregation (last sold date, last store date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So instead of coding only the name of the field, code the Sum() of the SalesQuantity values for the last 30 days, which is what I proposed above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; StoreDate = {'&amp;gt;=$(=AddMonths(Date, -1))'} &amp;gt;} SalesQuantity)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way yes, it should be StoreDate or the date field you want to get the last 30 days of sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jul 2011 08:35:17 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2011-07-08T08:35:17Z</dc:date>
    <item>
      <title>Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263975#M1191437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i am creating an application to show current stock levels for all products in all of our retail stores.&lt;/P&gt;&lt;P&gt;I am trying to show this information in a straight table. I have a couple of date fields which i need to use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StoreDate (which is the date the record was created)&lt;/P&gt;&lt;P&gt;LastSoldDate (which is the date the product was last sold)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data comes in every night from each store and is processed early hours each morning, which means that in the space of a week, there will be 7 records per product, all with a different StoreDate and most with a different LastSoldDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i try and create this chart, several lines appear per product (as it obviously shows any record processed for that product/store. I only want the chart to show the most CURRENT record. &lt;/P&gt;&lt;P&gt;In the example below, there are 4 lines for the same product. The 4 records have 2 different StoreDates and each different StoreDate has 2 different LastSoldDates.&lt;/P&gt;&lt;P&gt;I only want the chart to display the latest StoreDate with the latest LastSoldDate (The bottom line in this example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="untitled.JPG" class="jive-image-thumbnail jive-image" height="89" onclick="" src="https://community.qlik.com/legacyfs/online/5722_untitled.JPG" width="839" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i also need it to do something else. I need it to completely ignore any date selection (i have attached a QV doc, the dates selections are on the top row) but i want it to accept any other selection (from the left hand side.. customer, product etc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me with this please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 08:59:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263975#M1191437</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-07T08:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263976#M1191438</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;Still not sure what you want to achieve but I added a chart which does show&amp;nbsp; line with latest StoreDate independ of any selection on StoreDate. See file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:16:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263976#M1191438</guid>
      <dc:creator />
      <dc:date>2011-07-07T09:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263977#M1191439</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;I'd use the following expressions to get the latest date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;FirstSortedValue(If(Aggr(Max(LastSoldDate), StoreNumber) = LastSoldDate, LastSoldDate), -StoreDate)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the quantity sold this date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(FirstSortedValue(If(Aggr(Max(LastSoldDate), StoreNumber) = LastSoldDate, LastSoldDate), -StoreDate) = StoreDate, SalesQuantity)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to cumbersome, and probably will perform poor enough as to make some flag fields in the script where you get the last dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small active_link" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:27:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263977#M1191439</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-07T09:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263978#M1191440</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;Treid it again but then via a 'detour' as I struggled with date field. Define 3 variables vYear, VMonth, vDay and use those in the set analyses. I think this what you were looking for in the beginning. Check it out and let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:40:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263978#M1191440</guid>
      <dc:creator />
      <dc:date>2011-07-07T09:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263979#M1191441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel, Thanks, that seems to do exactly what i want. But How would i put this into the script? and would it cause an un-optmised load?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:41:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263979#M1191441</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-07T09:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263980#M1191442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Jonathan, Miguel posted a solution which seems to do the trick &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; but i really appreciate your help in this &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:42:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263980#M1191442</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-07T09:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263981#M1191443</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;As a general rule, any change you do in the script when loading from QVD files will make the load unoptimized, so you might need two loads, and do the flag fields in the load from database and store into the qvd with all aggregations done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can easily get the last StoreDate and LastSoldDate using the Max() function in either the SQL statement or the LOAD part, and store them into variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, compare each record in the load with those variables using a conditional and use the amount to be displayed in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thinking aloud (untested)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;MaxDates:&lt;/P&gt;&lt;P&gt;LOAD MaxStoreDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaxLastSoldDate;&lt;/P&gt;&lt;P&gt;SQL SELECT Max(StoreDate) as MaxStoreDate, Max(LastSoldDate) as MaxLastSoldDate FROM Database.Table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxStore = FieldValue('MaxStoreDate', 1);&lt;/P&gt;&lt;P&gt;LET vMaxSold = FieldValue('MaxLastSoldDate', 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(StoreDate = $(vMaxStore) AND LastSoldDate = $(vMaxSold), SalesQuantity) AS LastSalesQuantity;&lt;/P&gt;&lt;P&gt;SQL SELECT ... FROM ...;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just an idea, it needs to fit your data model. If your document performs fine, you can leave as it is, it all depends on the volume you are loading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small active_link" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 09:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263981#M1191443</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-07T09:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263982#M1191444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Miguel, much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 10:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263982#M1191444</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-07T10:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263983#M1191445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;Sorry to bother you again..&lt;/P&gt;&lt;P&gt;You gave me the following expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN style="color: #333333;"&gt;If(FirstSortedValue(If(Aggr(Max(LastSoldDate), StoreNumber) = LastSoldDate, LastSoldDate), -StoreDate) = StoreDate, SalesQuantity)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Could you tell me how i would change this expression to get the average sales quantity over the last 4 weeks?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 14:28:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263983#M1191445</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-07T14:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263984#M1191446</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;What about the following expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(FirstSortedValue(If(Aggr(Max(LastSoldDate), StoreNumber) = LastSoldDate, LastSoldDate), -StoreDate) = StoreDate, Sum({&amp;lt; Date = {'&amp;gt;=$(=AddMonths(Date, -1))'} &amp;gt;} SalesQuantity))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using the field to be shown, use an aggregation function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 23:04:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263984#M1191446</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-07T23:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263985#M1191447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Miguel, thanks for that. When i copy it into an expression, the Date part of it "Sum({&amp;lt; &lt;STRONG&gt;Date &lt;/STRONG&gt;= {'&amp;gt;=$(=AddMonths"&lt;/P&gt;&lt;P&gt;is underlined red. Should this be my date field (StoreDate). And i don't know if im being stupid &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt; but what do you mean by...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instead of using the field to be shown, use an aggregation function.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sorry, i'm not the best on set analysis and expressions! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 08:11:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263985#M1191447</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T08:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263986#M1191448</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;What I mean is that in the original expression, you were using "SalesQuantity" at the end of the expression. That shows only the value of that field for the aggregation (last sold date, last store date).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So instead of coding only the name of the field, code the Sum() of the SalesQuantity values for the last 30 days, which is what I proposed above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;Sum({&amp;lt; StoreDate = {'&amp;gt;=$(=AddMonths(Date, -1))'} &amp;gt;} SalesQuantity)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way yes, it should be StoreDate or the date field you want to get the last 30 days of sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 08:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263986#M1191448</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-08T08:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263987#M1191452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for all your help Miguel, It's very much appreciated &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 08:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263987#M1191452</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T08:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263988#M1191453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Sorry again, I am struggling with my chart. All you have thelped me with so far worked great as i was only testing it for ONE product. I have just tried viewing ALL products for a specific store, but it only show's me ONE (The latest StoreDate and latest LastSoldDate). I need it to show every product, but where there are multiple entries for the same product that's where i would want the expression to kick in and only show the latest product. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="untitled.JPG" class="jive-image-thumbnail jive-image" height="83" onclick="" src="https://community.qlik.com/legacyfs/online/5750_untitled.JPG" width="647" /&gt;&lt;/P&gt;&lt;P&gt;The top 3 above should be hidden, as the 4th in the list is the latest one. &lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 09:04:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263988#M1191453</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T09:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263989#M1191454</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 will need to add those fields to the Aggr() function. In this case I was aggregating by StoreNumber as you can see in the code above, so try replacing with the following instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;FirstSortedValue(If(Aggr(Max(LastSoldDate), StoreNumber, ProductNumber) = LastSoldDate, LastSoldDate), -StoreDate)&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change "ProductNumber" by your actual product code number field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 10:25:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263989#M1191454</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-08T10:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263990#M1191455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Miguel, Yes i tried this just after i asked for your help again and it worked great. I changed all expressions to include the extra dimensions and it gave me the result i was looking for. &lt;/P&gt;&lt;P&gt;Thanks again for all your help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;The people using Qlik Community are so helpful &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 10:42:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263990#M1191455</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T10:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263991#M1191456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Miguel, this i sthe last time i bother you i promise &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Just wondering how the expression works which you gave me for the last 4 weeks average sales &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(FirstSortedValue(If(Aggr(Max(LastSoldDate),[Product Code],StoreNumber) = LastSoldDate, LastSoldDate), -StoreDate) = StoreDate, sum({&amp;lt; StoreDate = {'&amp;gt;=$(=AddMonths(StoreDate, -1))'} &amp;gt;}SalesQuantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see that this expression adds in the last months worth of sales. How would i get just the last 28 days instead of month? and i would like it to be the last 4 FULL weeks, i.e. Mon-Sun. So if i used the app today (8/7/11), it would give me the average sales between 6th June - 3rd June.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this too awkward?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 10:53:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263991#M1191456</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T10:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263992#M1191457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates are numeric values in QlikView, so you can substract to the date field 28 units (days). So something like the following should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Sum({&amp;lt; StoreDate = {'&amp;gt;=$(=Date(StoreDate -28))'} &amp;gt;} SalesQuantity)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 10:56:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263992#M1191457</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-07-08T10:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with displaying current details</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263993#M1191458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; i will leave you alone now &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 12:23:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-displaying-current-details/m-p/263993#M1191458</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-07-08T12:23:55Z</dc:date>
    </item>
  </channel>
</rss>

