Frankicks
Frankicks

Reputation: 39

Set analysis not working as intended

I'm creating a dashboard for a school project, and I just came to the conclusion my set analysis is not working correctly. I have a funnel chart with the turnover of the employees who are working at the company for less than 20 years.

foo

I have this same funnel chart for employees who work at the company for more than 20 years. Now when I click on, for example, the red, all level 2 sales employees who work <20 years should be displayed in this table:

bar

But it stills shows the people who are working there for longer than 20 years.

This is my code:

sum({1<SALES_STAFF_WORKEXPERIENCE_nr = {"<20"}, SALES_STAFF_POSITION_en = {'Level 1 Sales Representative', 'Level 2 Sales Representative', 'Level 3 Sales Representative'}>} ORDER_DETAILS_turnover)

sum({1<SALES_STAFF_WORKEXPERIENCE_nr = {">=20"}, SALES_STAFF_POSITION_en = {'Level 1 Sales Representative', 'Level 2 Sales Representative', 'Level 3 Sales Representative'}>} ORDER_DETAILS_turnover)

Upvotes: 1

Views: 565

Answers (1)

The Budac
The Budac

Reputation: 1633

This is a common problem with set analysis. Because you have specified the selection SALES_STAFF_POSITION_en = {'Level 1 Sales Representative', 'Level 2 Sales Representative', 'Level 3 Sales Representative'}

Selecting one of those values will be ignored and all three levels displayed.

You need to make it the intersection of selections and the set it's a small change but often overlooked, see below:

sum({1<SALES_STAFF_WORKEXPERIENCE_nr = {"<20"}, SALES_STAFF_POSITION_en = p(SALES_STAFF_POSITION_en)* {'Level 1 Sales Representative', 'Level 2 Sales Representative', 'Level 3 Sales Representative'}>} ORDER_DETAILS_turnover)

sum({1<SALES_STAFF_WORKEXPERIENCE_nr = {">=20"}, SALES_STAFF_POSITION_en =p(SALES_STAFF_POSITION_en)* {'Level 1 Sales Representative', 'Level 2 Sales Representative', 'Level 3 Sales Representative'}>} ORDER_DETAILS_turnover) 

The p() means possible values in the field. I think there is a simpler syntax but I don't use it because this reads easier for me.

Also if those levels are the only 3 levels then you don't need to include them in the set analysis at all, unless you actually want to override any selections that get made in that dimension

Upvotes: 1

Related Questions