4 Replies Latest reply: Oct 11, 2012 6:16 AM by absolutwilot RSS

    Analysis expression with sum (help)

      Hi,

       

      Im relative new to Qlikview, so it can be a stupid question

       

      Situation:

      I got a straight table with the dimension "Klant" (customer in english), also i got an expression for the sum of his sales. but the problem now is i want a ratio of that customer with his country. So in fact sum(sales customer) / sum(sales country).

      Each sales record contains a customerNumber, Country number and a saleprice

       

      Problem:

      I cant get the total of the sales from country, because the dimension is klant (customer) the sales are grouped by customer. im trying to get it by analysis expression but i cant get the right results

       

      the expression i have is:

      =sum(total {1<landnummer= {$(=only({$}landnummer))}>} omzet)

      translation:

           landnummer = countrynumber,

           omzet  = salesprice

       

      When i split up the two expressions they both works fine:

      =sum(total {1<landnummer= {1}>} omzet) // returns all sales record from country 1

      =only({$} landnummer)  // returns the country nummber of the record

       

      I hope u got all the needed information and sorry for my english (not a native english speaker)

       

      Thanks in advance