Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
simonqv16
New Contributor III

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
simonqv16
New Contributor III

Re: Sales range as calculated dimension

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

View solution in original post

9 Replies

Re: Sales range as calculated dimension

Check my response here:

Sales range as chart dimension

Partner
Partner

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:

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

simonqv16
New Contributor III

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?

Highlighted
simonqv16
New Contributor III

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

Partner
Partner

Re: Sales range as calculated dimension

Can you leave us a picture of the problem? Thanks

simonqv16
New Contributor III

Re: Sales range as calculated dimension

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

View solution in original post

Re: Sales range as calculated dimension

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