Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

joshibabu_are
New Contributor

sort order in straight table

Hi Guru;s

I want to sort country column based on total employee count in all locations.

example :BU-API

                Country - USA

           employee count in 5 locations in us is less when compared to ITA(ITALY).

So ITA Should show first in Country column

US Head Count:431---For Business Unit-API

ITA head Count 505------For Business Unit-API

here pivot table not preferable because iam going to use this table in Nprinting.Nprinting wont support pivot table.

Please find the attached qlikview file

Thanks,

Joshi

1 Solution

Accepted Solutions

Re: sort order in straight table

Looks better?

Updated: Use a calculated dimension like this

Dual(Country, Aggr(NODISTINCT Sum([Actial Headcount]), [Business Unit], Country))

13 Replies
pritamb89
Contributor

Re: sort order in straight table

Add a expression as Sort Expression

AGGR(sum([2017 EOY Headcount]),Country,[Business Unit])

In sort Promote this expression to the top and Sort it in a Descending Order.

From Presentation tab Hide this expression.

sdf.PNG

YoussefBelloum
Esteemed Contributor

Re: sort order in straight table

Hi,

do you want to create the sorting based on the total employees count or on the total employees count for business unit API ??

because on the total without choosing a business unit, US should be Ranked N1

joshibabu_are
New Contributor

Re: sort order in straight table

i want to show based on actual headcount expression .

iam going to write this sort expression in Country sort expression

Thanks

YoussefBelloum
Esteemed Contributor

Re: sort order in straight table

Yes I understand that.

US is ranked 1 based on the GRAND TOTAL

and ITALY is ranked 1 base on the total by BU

if you're looking for the second option so take the solution provided above by Pritam

joshibabu_are
New Contributor

Re: sort order in straight table

hi Pritam Thanks for your time.

all the Business units should be one place after that DDA, next DP   .....

how to achieve this

Thanks

Highlighted

Re: sort order in straight table

Is this what you are after?

Capture.PNG

Created an extra expression using this expression

Aggr(NODISTINCT Sum([Actual Headcount]), [Business Unit], Country)

Used it second in the sort order and hide the expression from the presentation tab.

joshibabu_are
New Contributor

Re: sort order in straight table

Iam working in qlik sense environment

any thoughts how to achieve same in Qlik sense

Re: sort order in straight table

Nice, you shared a qvw for qlik sense requirement ... Can you share the same thing in qvf to test out?

joshibabu_are
New Contributor

Re: sort order in straight table

same using in Qlik sense nothing change