12 Replies Latest reply: Mar 3, 2016 1:58 PM by YVES BLAKE RSS

    Custom Chart From Filtered Data

    Lokeshwer Sathyanarayanan

      I am planning to develop an extension to customize chart to cater my needs. I created an app and added filters to the sheet. Now based on the filtered conditions, I want to redraw the chart.


      So far I was able to get the entire data for the sheet from layout.qHyperCube.qDataPages[0].qMatrix

      Instead of "entire" data for the sheet, I need filtered once. Is it possible in straight forward ways?

      Otherwise, I am planning to use model.layout.qSelectionObject.qSelections and filter manually.


      Please suggest. Let me know if you need more context.

        • Re: Custom Chart From Filtered Data
          Alexander Karlsson



          I would suggest you check out some of the introduction videos to how our associative technology works, this is the starting point for a multi-part series of short videos explaining it https://www.youtube.com/watch?v=gg-DRT3SwDM


          But in short, beneath every app is a data model. Every selection in Qlik will filter the data model to figure out which data values are associated with your selection. Then ALL sheets and objects re-calculate to now show you what is available in terms of data after your data model is now filtered.


          If you wish to manipulate the selected state that can usually be done through what we call Set Analysis in your expressions. For example, Sum({1<Year = {'2015'}>} Sales) would give you the sum of sales, ignoring the selection that in the app BUT with a implicit selection in the field Year with the value 2015.

            • Re: Custom Chart From Filtered Data
              Lokeshwer Sathyanarayanan

              Sorry. That wasn't helpful at all.

              I went through the example extensions. This wasn't covered there. I wouldn't post specific question if the generic an


              Can you be specifically address the query? How to access the filtered set of rows from extension?

                • Re: Custom Chart From Filtered Data
                  Alexander Karlsson

                  Yes that is what I'm trying to do.
                  Your extension will calculate based on the available data. If you wish to provide the arbitrary filters for your aggregation then you could use Set Analysis as I pointed out above, here is a good intro Set analysis – an introduction ‒ Qlik Sense


                  What you have to understand is that you don't filter just the extension, Qlik maintains a global selection model/state so if you filter the extension then the app will also filter to match your selections. The way to break that model is through Set Analysis.


                  Edit: The best way would be for you to first emulate what you are trying to do in a native Table object in Qlik Sense. Extensions uses the same underlying data construct so if you can make it work as you want there then you can also make it work in a extension.

                    • Re: Custom Chart From Filtered Data
                      Lokeshwer Sathyanarayanan

                      I went through the video wasting more time. That is not what I asked. Please do spend sometime on understanding the request before pointing to another set of videos


                      I have been working on QlikSense for more than a year. The response so far has been good. But this time I am left with no solutions. At the end of this exercise if things go futile, I am going to report my management that it is not possible pointing to this thread and seek for alternate product.


                      If you are not understanding the use case I reported, I can summarize again.


                      1. I use QlikSense Server

                      2. I use QPS to integrate seamless with the web application that we have

                      3. I have an extension that can link to our web application and the link carries the filter selections. (model.layout.qSelectionObject.qSelections)

                      4. Now along with filter selections, I need access to the filtered data which I can use to plot under the web application (Not in Qlik Sense Hub)

                      • Re: Custom Chart From Filtered Data
                        Lokeshwer Sathyanarayanan

                        To add further, I need access to facts for the selected dimensions

                  • Re: Custom Chart From Filtered Data
                    YVES BLAKE

                    In Qlik Sense client, each user selection fires a paint event and layout.qHyperCube.qDataPages[0].qMatrix is filled with filtered data, all extensions use that straight forward mechanism...


                    If your selection doesn't come straight from a Sense object, but from an external part of your application, you may need to apply selections by code using selectValues


                    If you embed single charts, you can also specify somme seclections in the URL with Single Integration API


                    If hope it may helps...