<?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 Calculated dimension based on max value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-max-value/m-p/129626#M758690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with items, the batch numbers of the items, the state of the batch (&lt;SPAN style="font-size: 13.3333px;"&gt;CETAT_LOT)&lt;/SPAN&gt;, the date of the state change (DATEEFFET_LOT).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The states can be programmed in advance, so for example, a batch of an item can go from&amp;nbsp; "Open" to the state "For destruction" at a certain date in the product life span.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a pivot table showing : the month (&lt;SPAN style="font-size: 13.3333px;"&gt;DATEJOUR) &lt;/SPAN&gt;, items, batch number, and the current state of the batch depending on the month selected.&amp;nbsp; I will then sum the quantities and value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hung up on finding the current state.&amp;nbsp; Currently to show all states that are before the month selected I have the following :&lt;/P&gt;&lt;P&gt;=if ( DATEEFFET_LOT&amp;lt;= DATEJOUR, CETAT_LOT )&lt;/P&gt;&lt;P&gt;Now I need to take it one step further, and find the max of the states based on the DATEEFFET_LOT&amp;lt;= DATEJOUR.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm a real newbie to this so I can't seem to figure out if I should use aggr, firstsortedvalue, max, or a combination of all of these!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example here, you can see on the 3rd and 4th lines, an example of a batch that has two states that started before July 31st.&amp;nbsp; I need to take only the last one, so the state = DIS that started the 5th of June.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen shot.png" class="jive-image image-1" height="221" src="/legacyfs/online/212025_screen shot.png" style="height: 221px; width: 810.769px;" width="811" /&gt;&lt;/P&gt;&lt;P&gt;If anyone can give me some help with this, you'll be my qlikview hero!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>leenlart</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Calculated dimension based on max value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-max-value/m-p/129626#M758690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with items, the batch numbers of the items, the state of the batch (&lt;SPAN style="font-size: 13.3333px;"&gt;CETAT_LOT)&lt;/SPAN&gt;, the date of the state change (DATEEFFET_LOT).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The states can be programmed in advance, so for example, a batch of an item can go from&amp;nbsp; "Open" to the state "For destruction" at a certain date in the product life span.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a pivot table showing : the month (&lt;SPAN style="font-size: 13.3333px;"&gt;DATEJOUR) &lt;/SPAN&gt;, items, batch number, and the current state of the batch depending on the month selected.&amp;nbsp; I will then sum the quantities and value.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hung up on finding the current state.&amp;nbsp; Currently to show all states that are before the month selected I have the following :&lt;/P&gt;&lt;P&gt;=if ( DATEEFFET_LOT&amp;lt;= DATEJOUR, CETAT_LOT )&lt;/P&gt;&lt;P&gt;Now I need to take it one step further, and find the max of the states based on the DATEEFFET_LOT&amp;lt;= DATEJOUR.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm a real newbie to this so I can't seem to figure out if I should use aggr, firstsortedvalue, max, or a combination of all of these!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example here, you can see on the 3rd and 4th lines, an example of a batch that has two states that started before July 31st.&amp;nbsp; I need to take only the last one, so the state = DIS that started the 5th of June.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen shot.png" class="jive-image image-1" height="221" src="/legacyfs/online/212025_screen shot.png" style="height: 221px; width: 810.769px;" width="811" /&gt;&lt;/P&gt;&lt;P&gt;If anyone can give me some help with this, you'll be my qlikview hero!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-max-value/m-p/129626#M758690</guid>
      <dc:creator>leenlart</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated dimension based on max value</title>
      <link>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-max-value/m-p/129627#M758691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(max(TOTAL &amp;lt;DATEJOUR, LOT&amp;gt; DATEEFFET_LOT)=DATEEFFET_LOT,CETAT_LOT,Null())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 15:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculated-dimension-based-on-max-value/m-p/129627#M758691</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2018-08-28T15:20:34Z</dc:date>
    </item>
  </channel>
</rss>

