9 Replies Latest reply: Mar 24, 2017 4:53 AM by Sunny Talwar

# Sales range as calculated dimension

Hi,

Does anyone know how to make a bar chart that count the number of salesperson by sales-range as calculated dimension?  Thanks.

SalespersonSales in Mar
A300
A1500
B900
B300
C200
C300

Expected result

Sales < 1000 :  1 salesperson (C)

Sales > 1000 and < 2000 :  2 salesperson (A & B)

• ###### Re: Sales range as calculated dimension

Check my response here:

Sales range as chart dimension

• ###### Re: Sales range as calculated dimension

Thank you.

After applied modifier to the script, it turned out invalid dimension.  Following is the script:

=Aggr(if(Sum({<[PRODUCTION.CATE_CODE]={'01'}, [PRODUCTION.MONTH_PERIOD]={'13'}>}[PRODUCTION.SALES]    ) < 10000,  'Sales < 10000',  'Sales >= 10000'),[SalePerson])

• ###### Re: Sales range as calculated dimension

I don't see anything wrong here, would you be able to share a sample where you tried this and it did not work?

• ###### Re: Sales range as calculated dimension

Corrected the script, now it works.  Thanks.

For salesperson without any sales record, it returns a ' - ' group.  How can it combine with the 0-sales group?

Sales        No. of Sales person

0               10

<100          22

-                 15

• ###### Re: Sales range as calculated dimension

It should fall into <100, is it not? Difficult to say without taking a look

• ###### Re: Sales range as calculated dimension

Can you leave us a picture of the problem? Thanks

• ###### Re: Sales range as calculated dimension

try to alter your script like this:

the in your bar chart, as dimension 'sales amount' and measure: count(salesman)

table:

SalesMan,

Sales

from ....

leftj join(table)

SalesMan,

sum(Sales) as SommeSales

Resident table

Group By SalesMan;

SalesTable:

Sales,

if(SommeSales<=1000,'<1000','>1000') as "Sales Amount",

Resident table;

DROP Table table;

result:

• ###### Re: Sales range as calculated dimension

Found work around to the issue.   Thanks Sunny and Omar.

• ###### Re: Sales range as calculated dimension

What was the work around? Can you share that information with us?