4 Replies Latest reply: Mar 3, 2017 7:44 AM by Sunny Talwar RSS

    Line chart that shows Percentage

    Giulio Andrea Toscano

      Hi All,

       

      I am facing one problem on qlik. I am not able to create a line chart that shows the differences among different classes for different product. The chart that I can develop does his job only if I select only one product. If I select 2 product the percentage will in automatic calculated on an overall basis (I want that the percentage will be always calculated on each product basis and not on overall basis).

       

      To explain me better attached an example:

      if I select 2 product

      Capture.JPG

      If I select only one product

      Capture.JPG

       

      My chart is a simple line chart with 2 dimensions:

      1) a nested if to created the classes

      2)Product name

       

      the only measures is:

      3)

      count (distinct [Customer id])

      /

      count (distinct total [Customer id])

       

       

      I thought that count(distinct total <Product name> [Customer id]) should works but it doesn't

       

      Any help will be really appreciated,

       

      Giulio

        • Re: Line chart that shows Percentage
          Sunny Talwar

          Would you be able to share numbers you are getting and the number you expect to get? Also, what is your nested if  statement? Can you move that to the script and try this

           

          Count(DISTINCT TOTAL <NewField> [Customer id])

            • Re: Line chart that shows Percentage
              Giulio Andrea Toscano

              Hi Sunny, thank you for your answer, there is no way to fix it directly into the the Front End? I always would like to have the full flexibility in my selection that is the reason way I want to develop this analysis directly in the Front End

               

              Following my nested if:

               

              if(

                  aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=3,

                          'A 1-3',

                    if(

                  aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=10,

                          'B 4-10',

                         if(

                  aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=25,

                          'C 11-25',

                            if(

                     aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=50,

                               'D 26-50',

                                if(

                         aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=100,

                                  'E 51-100',

                                  if(

                             aggr(count(distinct [ID]), [Session id],[Customer ID],[Product Name])<=200,

                                        'F 101-200',

                                                                      'G 201+'

                                                                      ))))))

            • Re: Line chart that shows Percentage
              sumit jadhav

              HI,

              Kindly provide me with the sample data