7 Replies Latest reply: Apr 27, 2012 11:00 AM by jonraine RSS

    Newbie seeking Syntax Help - Count

      Hi,

       

      I am still learning the basics of QlikView and would appreciate some help.

       

      This may not be even close to the correct syntax, but I have been unable to  find (or use trial and error) the correct syntax / operators.

       

      This is an expression from a chart object (a dial) and I am looking to add up all of the instances for the three "COUNT Scenarios" below...

       

       

      =SUM(COUNT({<

      STATUS={'Completed','Processed'},

      TASK_TYPE={'Receipt'},

      TASK_DURATION={"<=3"}

       

      COUNT({<

      STATUS={'Completed','Processed'},

      TASK_TYPE={'Confirmation'},

      TASK_DURATION={"<=5"}

       

      COUNT({<

      STATUS={'Completed','Processed'},

      TASK_TYPE={'Order'},

      TASK_DURATION={"<=1"}

       

      >}TASK_REF)

       

      Obviously, it doesn't work - but I can not work out how to fix it.

       

      Any help will be appreciated !!

       

      Thanks,

       

      Jonathan

        • Re: Newbie seeking Syntax Help - Count
          Miguel Angel Baeyens de Arce

          Hi,

           

          Is this what you are looking for? (Counting all three possible instances of TASK_REF)

           

          =COUNT({<
          STATUS={'Completed','Processed'}, 
          TASK_TYPE={'Receipt'},
          TASK_DURATION={"<=3"} 
          > + <
          STATUS={'Completed','Processed'}, 
          TASK_TYPE={'Confirmation'},
          TASK_DURATION={"<=5"} 
          > + <
          STATUS={'Completed','Processed'}, 
          TASK_TYPE={'Order'},
          TASK_DURATION={"<=1"}
          >} TASK_REF)
          

           

          Hope that helps.

           

          Miguel

            • Newbie seeking Syntax Help - Count

              Miguel,

               

              That is great, thank you - exactly what I was looking for.

               

              It does however highlight something else that I must now learn.

               

              As you may have guessed, I am calculating SLA performance metrics.

               

              I have used your suggestion as follows:

               

              =COUNT({<
              STATUS={'Completed','Processed'},
              TASK_TYPE={'Receipt'},
              TASK_DURATION={"<=3"}
              > + <
              STATUS={'Completed','Processed'},
              TASK_TYPE={'Confirmation'},
              TASK_DURATION={"<=5"}
              > + <
              STATUS={'Completed','Processed'},
              TASK_TYPE={'Order'},
              TASK_DURATION={"<=1"}
              >} TASK_REF)

               

              /

              COUNT({<

              STATUS={'Completed','Processed'},

              TASK_TYPE={'Receipt','Confirmation','Order'}

              >} TASK_REF)

               

               

              It now says "No data to display" - my guess is because we have not yet had any instances of "Confirmation" or "Order".

               

              Is there an easy fix?

               

              Many thanks

               

              Jonathan

               

              • Re: Newbie seeking Syntax Help - Count

                Miguel,

                 

                That is great, thank you - exactly what I was looking for.

                 

                It does however highlight something else that I must now learn.

                 

                As you may have guessed, I am calculating SLA performance metrics.

                 

                I have used your suggestion as follows:

                 

                =COUNT({<
                STATUS={'Completed','Processed'},
                TASK_TYPE={'Receipt'},
                TASK_DURATION={"<=3"}
                > + <
                STATUS={'Completed','Processed'},
                TASK_TYPE={'Confirmation'},
                TASK_DURATION={"<=5"}
                > + <
                STATUS={'Completed','Processed'},
                TASK_TYPE={'Order'},
                TASK_DURATION={"<=1"}
                >} TASK_REF)

                 

                /

                COUNT({<

                STATUS={'Completed','Processed'},

                TASK_TYPE={'Receipt','Confirmation','Order'}

                >} TASK_REF)

                 

                 

                It now says "No data to display" - my guess is because we have not yet had any instances of "Confirmation" or "Order".

                 

                Is there an easy fix?

                 

                Many thanks

                 

                Jonathan

                 

              • Re: Newbie seeking Syntax Help - Count
                Celambarasan Adhimulam

                Hi,

                     Did you expected this result?

                    

                COUNT({<

                STATUS={'Completed','Processed'},

                TASK_TYPE={'Receipt','Confirmation','Order'},

                TASK_DURATION={"<=5"} TASK_REF)

                 

                Celambarasan