<?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 Straight table filtering and expression problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Straight-table-filtering-and-expression-problem/m-p/564587#M210714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to filter a table with specific conditions but I have some problem with the expression.&lt;/P&gt;&lt;P&gt;The starting table is the one in FigureA.&lt;/P&gt;&lt;P&gt;I have an input box (Data1 variable) to filter on the Date column and I have the following dimensions: Code, Date, Type.&lt;/P&gt;&lt;P&gt;The expression is: Value.&lt;/P&gt;&lt;P&gt;What I want to achieve is to show the rows under a specific date, of Type A and with the Value related to the closest date for that Code.&lt;/P&gt;&lt;P&gt;This is the expression for the calculated dimension Date:&lt;/P&gt;&lt;P&gt;= if(len(Data1) = 0 , Date, if(num(Date) &amp;lt;= Num(Data1), Date,null()))&lt;BR /&gt;This is the expression for the calculated dimension Type: &lt;/P&gt;&lt;P&gt;= if(Type = 'A', Type, null())&lt;/P&gt;&lt;P&gt;I suppress the null values.&lt;/P&gt;&lt;P&gt;I obtain the table in FigureB.&lt;/P&gt;&lt;P&gt;Now the problem is to show on the column Value the value related to the closest date for each Code (Figure C).&lt;/P&gt;&lt;P&gt;I tried with the following expression:&lt;/P&gt;&lt;P&gt;aggr( max({$&amp;lt;TRDATE = {'=$(FilterAll)'}&amp;gt;} Value),Date), with FilterAll: =aggr( max(TOTAL&amp;nbsp; {$&amp;lt;Date = {'&amp;lt;=$(=Data1)'}&amp;gt;} Date),Code,Date)&lt;/P&gt;&lt;P&gt;The strange behaviour is that if the date is correct it shows the value corresponding to the lower date for that code (Value 111 for Code 0000017) or a null value while it works when the closest day is not the one selected (Value 104 for Code 0000012)&lt;/P&gt;&lt;P&gt;How can I obtain the FigureC?&lt;/P&gt;&lt;P&gt;Thank you and best regards,&lt;/P&gt;&lt;P&gt;Eros&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2014 09:19:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-25T09:19:23Z</dc:date>
    <item>
      <title>Straight table filtering and expression problem</title>
      <link>https://community.qlik.com/t5/QlikView/Straight-table-filtering-and-expression-problem/m-p/564587#M210714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to filter a table with specific conditions but I have some problem with the expression.&lt;/P&gt;&lt;P&gt;The starting table is the one in FigureA.&lt;/P&gt;&lt;P&gt;I have an input box (Data1 variable) to filter on the Date column and I have the following dimensions: Code, Date, Type.&lt;/P&gt;&lt;P&gt;The expression is: Value.&lt;/P&gt;&lt;P&gt;What I want to achieve is to show the rows under a specific date, of Type A and with the Value related to the closest date for that Code.&lt;/P&gt;&lt;P&gt;This is the expression for the calculated dimension Date:&lt;/P&gt;&lt;P&gt;= if(len(Data1) = 0 , Date, if(num(Date) &amp;lt;= Num(Data1), Date,null()))&lt;BR /&gt;This is the expression for the calculated dimension Type: &lt;/P&gt;&lt;P&gt;= if(Type = 'A', Type, null())&lt;/P&gt;&lt;P&gt;I suppress the null values.&lt;/P&gt;&lt;P&gt;I obtain the table in FigureB.&lt;/P&gt;&lt;P&gt;Now the problem is to show on the column Value the value related to the closest date for each Code (Figure C).&lt;/P&gt;&lt;P&gt;I tried with the following expression:&lt;/P&gt;&lt;P&gt;aggr( max({$&amp;lt;TRDATE = {'=$(FilterAll)'}&amp;gt;} Value),Date), with FilterAll: =aggr( max(TOTAL&amp;nbsp; {$&amp;lt;Date = {'&amp;lt;=$(=Data1)'}&amp;gt;} Date),Code,Date)&lt;/P&gt;&lt;P&gt;The strange behaviour is that if the date is correct it shows the value corresponding to the lower date for that code (Value 111 for Code 0000017) or a null value while it works when the closest day is not the one selected (Value 104 for Code 0000012)&lt;/P&gt;&lt;P&gt;How can I obtain the FigureC?&lt;/P&gt;&lt;P&gt;Thank you and best regards,&lt;/P&gt;&lt;P&gt;Eros&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Straight-table-filtering-and-expression-problem/m-p/564587#M210714</guid>
      <dc:creator />
      <dc:date>2014-02-25T09:19:23Z</dc:date>
    </item>
  </channel>
</rss>

