2 Replies Latest reply on Jan 18, 2019 12:07 AM by kookhee kim

    How to count dimensions by using section for measures

    kookhee kim

      Hello

       

      I want to make bar chart with discount rate by products.

      I want to count products number with discount rates. For example, Count products number if discount rate was under 10%, under 10 to 20%....

      and show the bar chart using percent of total. Below is example that I want to make.

      1.

      To make discount rate, I made calculation field...

      1- sum(net sales amount)/sum(retail price)

       

      2.

      I used 'IF' calculation field to make section for discount rate. The calculation name is [DC% SECTION]

       

      3. And I thought I can make bar chart I expected....

      I tried to use 'LOD' calculation to make bar. In picture, ship to means 'product'.

      But I can't make LOD calculation cause DC% section is aggregation. The calculation errors text was  "YOu cannot use aggregated expression as a dimension, because it is a measure"

      How can I make bar chart with discount rate???

        • 1. Re: How to count dimensions by using section for measures
          Jim Dehner

          Good morning - think of an LOD as saying in words "For each  then a dimension : countd whatever )  - based on the calculation tableau creates a virtual layer within your data set -

          that layer is a a higher level than the base level of the data set - so in your case you have something that is used to determine the discount rate - that something can be an account, an order, a market segment, or any dimension - in your case you said it is a product - so you need to create an LOD that says "for each product if the discount rate is less than .e then ... and so on

           

          you do  that by {fixed [Product}: then your conditional statement goes here }

           

           

           

          returns this

           

          Jim

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          • 2. Re: How to count dimensions by using section for measures
            kookhee kim

            Thank you JIM! It helped me to make correct chart!