7 Replies Latest reply on Dec 25, 2018 6:11 AM by Norbert Maijoor

    nested LOD calculation of sum across category

    Nellie Rajarova
      Category Id
      Subcategory Id
      Qty
      id1subid15
      id1subid15
      id1subid22
      id1subid22
      id1subid31

      I have a dataset that has category id, subcategory id and qty . There are others columns resulting in repetition of the same subcategory.

       

      I want to use and IF statement to filter out some Category Id and get the sum. I have to do it in two fold

       

      FIRST USE :

      IF [Category id] = 2834316 OR [Category id] = 2836481 THEN

           { EXCLUDE [Subcategory Id] :

                                   SUM({ INCLUDE [Subcategory Id],[Category id]:MAX([Qty])})}

      ELSE

      0

      END

       

       

      Then create a sum field :

      SUM(

          { FIXED [Category id] : MAX([qty by category]) }

         )

       

      Is there a method of achieving this without using a sum field.