6 Replies Latest reply: Aug 2, 2016 11:23 AM by Sunny Talwar RSS

    Bar Chart with many dimensions

    Oliver Kaus

      Dear QlikSense-Community,

       

      I have a question concerning creating a bar chart which I illustrate with the following example:

       

      The table contains the four programs A, B, C and D. Additionally, the column 'Company' contains a 'Yes' if the program is available for companies, 'Yes' if the program is available for Universities, etc.

       

      NameCompanyUniversityPrivate
      Program AYesYesYes
      Program BYesYesYes
      Program C YesNoNo
      Program DYesYesYes

       

      I intend to create a bar chart which contains the number of programs which are available for companies, universities and private.


      I would be glad if somebody could help me concerning this issue.


      Best,

      Oliver

        • Re: Bar Chart with many dimensions
          Sunny Talwar

          Option 1: Use CrossTable Load:

           

          Table1:

          CrossTable (Area, Flag)

          LOAD * INLINE [

          Name, Company, University, Private

          Program A, Yes, Yes, Yes

          Program B, Yes, Yes, Yes

          Program C, Yes, No, No

          Program D, Yes, Yes, Yes

          ];

           

          Dimension

          Area

           

          Expresison:

          Count({<Flag = {'Yes'}>}Flag)


          Capture.PNG

            • Re: Bar Chart with many dimensions
              Sunny Talwar

              Option2:

               

              Table1:

              LOAD * INLINE [

              Name, Company, University, Private

              Program A, Yes, Yes, Yes

              Program B, Yes, Yes, Yes

              Program C, Yes, No, No

              Program D, Yes, Yes, Yes

              ];

               

              Dim:

              LOAD * INLINE [

              Area, Dim

              Company, 1

              University, 2

              Private, 3

              ];

               

              Dimension:

              Area

               

              Expression:

              Pick(Dim,

              Count({<Company = {'Yes'}>}Company),

              Count({<University = {'Yes'}>}University),

              Count({<Private = {'Yes'}>}Private))

                • Re: Bar Chart with many dimensions
                  Oliver Kaus

                  Hey Sunny, thanks a lot for your help!

                   

                  I just realized that I have to create a pie instead of a bar chart. But I think that does not change the code right?

                   

                  Additionally, I am relatively new to QlikSense. I have a table with a lot of entries, what do I have to replace in the following code so that it automatically uses the entries that I have in my excel file? (I am referring to Option 2 because it seems easier to me)

                   

                  Table1:

                  LOAD * INLINE [

                  Name, Company, University, Private

                  Program A, Yes, Yes, Yes

                  Program B, Yes, Yes, Yes

                  Program C, Yes, No, No

                  Program D, Yes, Yes, Yes

                  ];



                  And in which field do I enter this code:

                  LOAD * INLINE [

                  Area, Dim

                  Company, 1

                  University, 2

                  Private, 3

                  ];


                  I am thankful for your help!

                   

                  Best,

                  Oliver