<?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 data manipulation - last child in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/data-manipulation-last-child/m-p/227383#M79494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;To answer your last question, in chart expression, you can know which dimension you are working on by using Dimensionality(). The leftmost dimension is 1, the one after that is 2 etc.&lt;/P&gt;&lt;P&gt;Based on this, you can create a if condition to get what you want. In your case, for months you want the sum of ages but for year you want the age of the last month of the year. Your expression will be&lt;/P&gt;&lt;P&gt;=if(Dimensionality()=1,Sum({&amp;lt;mon={"$(=max(mon))"}&amp;gt;}age),sum(age))&lt;/P&gt;&lt;P&gt;I have attached an example. Let me know if this is what you were looking for.&lt;/P&gt;&lt;P&gt;Nimish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 31 Jan 2010 03:31:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-01-31T03:31:03Z</dc:date>
    <item>
      <title>data manipulation - last child</title>
      <link>https://community.qlik.com/t5/QlikView/data-manipulation-last-child/m-p/227382#M79493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;lets sat we have this data fields,&lt;/P&gt;&lt;P&gt;mon, year, age&lt;/P&gt;&lt;P&gt;i wont to get the last age for each year.&lt;/P&gt;&lt;P&gt;if i looked on it in a pivot table by months i can see the total ages for each mon by&lt;/P&gt;&lt;P&gt;addig the expression sum(age) ,&lt;/P&gt;&lt;P&gt;but if i want to see it by years i want to get the age of the last month for each year,&lt;/P&gt;&lt;P&gt;i dont want to sum all ages for each year just the last one!!&lt;/P&gt;&lt;P&gt;any suggestion will be great.&lt;/P&gt;&lt;P&gt;And anther small question is , in a chart expretion how do i find to which dimension i worked&lt;/P&gt;&lt;P&gt;with mon or year ?(to set the right expression for each dim.)&lt;/P&gt;&lt;P&gt;thnx,&lt;/P&gt;&lt;P&gt;yuyu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jan 2010 00:10:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/data-manipulation-last-child/m-p/227382#M79493</guid>
      <dc:creator />
      <dc:date>2010-01-31T00:10:05Z</dc:date>
    </item>
    <item>
      <title>data manipulation - last child</title>
      <link>https://community.qlik.com/t5/QlikView/data-manipulation-last-child/m-p/227383#M79494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;To answer your last question, in chart expression, you can know which dimension you are working on by using Dimensionality(). The leftmost dimension is 1, the one after that is 2 etc.&lt;/P&gt;&lt;P&gt;Based on this, you can create a if condition to get what you want. In your case, for months you want the sum of ages but for year you want the age of the last month of the year. Your expression will be&lt;/P&gt;&lt;P&gt;=if(Dimensionality()=1,Sum({&amp;lt;mon={"$(=max(mon))"}&amp;gt;}age),sum(age))&lt;/P&gt;&lt;P&gt;I have attached an example. Let me know if this is what you were looking for.&lt;/P&gt;&lt;P&gt;Nimish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 Jan 2010 03:31:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/data-manipulation-last-child/m-p/227383#M79494</guid>
      <dc:creator />
      <dc:date>2010-01-31T03:31:03Z</dc:date>
    </item>
  </channel>
</rss>

