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

Sort Order with two dimensions and a expression

Hi, QlikView community

I have an easy data that has category for my companies (fish, food and machinery), Comapny then year and income

An example in the data look like this

  

CategoryCompany         Year        Income
FishSeafood20161.532.545,78
MachineryCars Inc.2016374.290,77
MachineryMachinery Inc.2016108.202,71

My problem is when I want to get sort order in my table.

I have sorted the companies after the biggest income (sum(income)).

But problem is when a do that is the companies that are big in many categories are always first.

But I want the category to be alphabetical order and then I want to have sort order after category and biggest income.

So I want the order for Fish to be the biggest in that category is first and then down the list:

1. Seafood

2. Fresh Food

3, Frozen Seafood

5. Frozen Food Inc.

   

CategoryCompany=sum(Income)
FishSeafood1.586.083
FishFrozen Seafood49.767
FishFresh Food54.499
FishFrozen Food Inc454
FoodFrozen Seafood500.000
FoodCandy Inc.2
MachineryCars Inc.376.647
MachineryMachinery Inc.111.400

regards Darru

1 Solution

Accepted Solutions
sunny_talwar

May be use a calculated dimension to replace Company

Capture.PNG

=Dual(Company, Aggr(Sum(Income), Category, Company))

View solution in original post

1 Reply
sunny_talwar

May be use a calculated dimension to replace Company

Capture.PNG

=Dual(Company, Aggr(Sum(Income), Category, Company))