<?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 Selecting the last 30 rows in filtered data in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Selecting-the-last-30-rows-in-filtered-data/m-p/1835582#M69035</link>
    <description>&lt;P&gt;Dear Qlik specialists,&lt;/P&gt;&lt;P&gt;Maybe you can set me on the right track in solving the following problem.&lt;/P&gt;&lt;P&gt;I have a dataset, containing (.. a lot, but for this example..) the following fields:&lt;BR /&gt;- date-timefield (MyDateTime) (not unique),&lt;BR /&gt;- ranknumber (calculated in the database SQL) (myRankNumber) ,&lt;BR /&gt;- value (MyValue),&amp;nbsp;&lt;BR /&gt;- dimension to distinquish null-values (MyNullValue),&amp;nbsp;&lt;BR /&gt;- dimension used for filtering the data (MyDimension)&lt;/P&gt;&lt;P&gt;In a Combochart, I am showing MyValue&amp;nbsp;against MyRank on the x-axis. I could not use the datetime because that yields a timeline, and the datapoints are not organized on a regular time base, and I did not want gaps or stretched lines against a time-axis.&lt;BR /&gt;So the RankNumber was generated in the SQL to be used as a dimension, to be able to connect all datapoints on the same distances on an x-axis.&lt;/P&gt;&lt;P&gt;Furthermore are there lines that don't have a Value (null)&lt;BR /&gt;To be able to exclude these lines a new dimension (MyNullValues) has been made in the SQL. In Qlik Sense cannot be filtered on NULL values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I did sofar is showing the graph for all data exept for the Null values. I did this by applying an If statement in the axis definition (Dimensions of the ComboChart).&lt;BR /&gt;IF ( MyNullValues = 'there is a value', MyRank)&lt;/P&gt;&lt;P&gt;That works out fine.&lt;BR /&gt;I sorted the data on MyRank, and that worked out fine as well.&lt;/P&gt;&lt;P&gt;Furthermore, I am filtering the dashboard (the combochart is one of the vizzes on that dashboard) by&amp;nbsp;MyDimension , which has effect on all vizzes on the dashboard, including this combochart.&lt;/P&gt;&lt;P&gt;Due to the filter by MyDimension the numbers in MyRank are not consecutive numbers anymore.&lt;BR /&gt;Now, I want to show only the last 30 datapoints in my combochart.&amp;nbsp;&lt;BR /&gt;The problem is that this combochart also contains calculated data like average and stddev related calculations. (upper and lower control limits)&lt;BR /&gt;So the last 30 datapoints should not only be shown in the visible part of the graph, but als well used to calculate those average and stdev based calculations.&lt;/P&gt;&lt;P&gt;I have tried to add an extra condition in the if statement for the axis, but that doesn't work.&lt;BR /&gt;IF ( MyNullValues = 'there is a value' and&amp;nbsp; (Rank(Max(aggr(Rank(MyRank),MyRank))) &amp;gt;&amp;nbsp;Rank(Max(aggr(Rank(MyRank),MyRank)))-30&amp;nbsp; )&amp;nbsp; , MyRank)&amp;nbsp;&lt;BR /&gt;// I have Ranked the Rank function because there are gaps in the original MyRank&lt;/P&gt;&lt;P&gt;I have tried similar set analysis constructions in the Dimension and in the Measures, but still I don't get the required outcome.&lt;/P&gt;&lt;P&gt;Maybe I am thinking far to difficult, I don't know.&lt;BR /&gt;So I hope there is someone out there that can give me a push in the right direction.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;BR /&gt;Rob&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 12:25:58 GMT</pubDate>
    <dc:creator>Rob29</dc:creator>
    <dc:date>2021-09-13T12:25:58Z</dc:date>
    <item>
      <title>Selecting the last 30 rows in filtered data</title>
      <link>https://community.qlik.com/t5/App-Development/Selecting-the-last-30-rows-in-filtered-data/m-p/1835582#M69035</link>
      <description>&lt;P&gt;Dear Qlik specialists,&lt;/P&gt;&lt;P&gt;Maybe you can set me on the right track in solving the following problem.&lt;/P&gt;&lt;P&gt;I have a dataset, containing (.. a lot, but for this example..) the following fields:&lt;BR /&gt;- date-timefield (MyDateTime) (not unique),&lt;BR /&gt;- ranknumber (calculated in the database SQL) (myRankNumber) ,&lt;BR /&gt;- value (MyValue),&amp;nbsp;&lt;BR /&gt;- dimension to distinquish null-values (MyNullValue),&amp;nbsp;&lt;BR /&gt;- dimension used for filtering the data (MyDimension)&lt;/P&gt;&lt;P&gt;In a Combochart, I am showing MyValue&amp;nbsp;against MyRank on the x-axis. I could not use the datetime because that yields a timeline, and the datapoints are not organized on a regular time base, and I did not want gaps or stretched lines against a time-axis.&lt;BR /&gt;So the RankNumber was generated in the SQL to be used as a dimension, to be able to connect all datapoints on the same distances on an x-axis.&lt;/P&gt;&lt;P&gt;Furthermore are there lines that don't have a Value (null)&lt;BR /&gt;To be able to exclude these lines a new dimension (MyNullValues) has been made in the SQL. In Qlik Sense cannot be filtered on NULL values.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I did sofar is showing the graph for all data exept for the Null values. I did this by applying an If statement in the axis definition (Dimensions of the ComboChart).&lt;BR /&gt;IF ( MyNullValues = 'there is a value', MyRank)&lt;/P&gt;&lt;P&gt;That works out fine.&lt;BR /&gt;I sorted the data on MyRank, and that worked out fine as well.&lt;/P&gt;&lt;P&gt;Furthermore, I am filtering the dashboard (the combochart is one of the vizzes on that dashboard) by&amp;nbsp;MyDimension , which has effect on all vizzes on the dashboard, including this combochart.&lt;/P&gt;&lt;P&gt;Due to the filter by MyDimension the numbers in MyRank are not consecutive numbers anymore.&lt;BR /&gt;Now, I want to show only the last 30 datapoints in my combochart.&amp;nbsp;&lt;BR /&gt;The problem is that this combochart also contains calculated data like average and stddev related calculations. (upper and lower control limits)&lt;BR /&gt;So the last 30 datapoints should not only be shown in the visible part of the graph, but als well used to calculate those average and stdev based calculations.&lt;/P&gt;&lt;P&gt;I have tried to add an extra condition in the if statement for the axis, but that doesn't work.&lt;BR /&gt;IF ( MyNullValues = 'there is a value' and&amp;nbsp; (Rank(Max(aggr(Rank(MyRank),MyRank))) &amp;gt;&amp;nbsp;Rank(Max(aggr(Rank(MyRank),MyRank)))-30&amp;nbsp; )&amp;nbsp; , MyRank)&amp;nbsp;&lt;BR /&gt;// I have Ranked the Rank function because there are gaps in the original MyRank&lt;/P&gt;&lt;P&gt;I have tried similar set analysis constructions in the Dimension and in the Measures, but still I don't get the required outcome.&lt;/P&gt;&lt;P&gt;Maybe I am thinking far to difficult, I don't know.&lt;BR /&gt;So I hope there is someone out there that can give me a push in the right direction.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;BR /&gt;Rob&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 12:25:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Selecting-the-last-30-rows-in-filtered-data/m-p/1835582#M69035</guid>
      <dc:creator>Rob29</dc:creator>
      <dc:date>2021-09-13T12:25:58Z</dc:date>
    </item>
  </channel>
</rss>

