Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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)

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

9 Replies
sunny_talwar

Check my response here:

Sales range as chart dimension

OmarBenSalem

try to alter your script like this:

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


table:

load

SalesMan,

Sales

from ....

leftj join(table)

LOAD

SalesMan,

sum(Sales) as SommeSales

Resident table

Group By SalesMan;

SalesTable:

LOAD SalesMan,

Sales,

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

Resident table;

DROP Table table;

result:

Capture.PNG

Anonymous
Not applicable
Author

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])

sunny_talwar

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

Anonymous
Not applicable
Author

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

sunny_talwar

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

OmarBenSalem

Can you leave us a picture of the problem? Thanks

Anonymous
Not applicable
Author

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

sunny_talwar

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