# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Dimensions based on Total and Aggr

Hi,

I am trying to create a table / bar chart in the UI that shows Sales by a dimension built in the UI.

The dimension is meant to categorize sales by both customer and year: below 50,000 will get group 'A', other wise 'B'.

For ex: customer no. 1 with sales of 10,000 in 2017 will be in group A, while the same customer in 2018 with 60,000 will be in group B.

However, whenever I select "A", i get both 'A' AND 'B', and visa versa.

I also need the Formula to allow use of Set Analysis.

What is wrong here?

=AGGR(IF(sum({<DataBase={'Customer Orders'}>} TOTAL <CustomerID,Year> Amount) < 50000,'A','B'),CustomerID,Year)

Thank you,

Sandra

11 Replies
MVP

Try this

=Aggr(If(Sum({<DataBase={'Customer Orders'}, CustomerID, Year>} Amount) < 50000,'A','B'), CustomerID, Year)

Contributor III
Author

thanks but same problem still

MVP

How about if you use this?

=Aggr(If(Sum({1<DataBase={'Customer Orders'}>} Amount) < 50000,'A','B'), CustomerID, Year)

Contributor III
Author

Thanks again bur still not showing good filter.

I would add a print screen here if I new how..

Sandra

MVP
Contributor III
Author

Thanks!

Here is the print screen

I have selected A but still the table shows B as well.

Sandra

Contributor III
Author

by the way,

if I remove the 1 from the set analysis of the MEASURE, I still get the exact same result

Sandra

MVP

What is the expression for your filter?

Contributor III
Author

the filter is the same as the Dimenstion column - same expression.

=Aggr(If(Sum({1<DataBase={'Customer Orders'}>} Amount) < 50000,'A','B'), CustomerID, Year)