Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

henrytang914
New Contributor

Columns ordering in pivot table

I draw data with below structure and put it into a pivot table.

Structure:

YY (year)

MM (month)

DD (Day)

RouteGroup

DailyOut

After putting in the pivot table, it looks like:

YY/MM/DD   RouteGroup1    RouteGroup2    RouteGroup3    RouteGroup4 ....

2018/05/01   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/02   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/03   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/04   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/05   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

...

The data showing correctly but I want to adjust the column order (e.g., change from leftmost to rightmost).

Like this:

YY/MM/DD   RouteGroup2    RouteGroup1    RouteGroup4    RouteGroup3 ....

2018/05/01   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/02   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/03   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/04   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

2018/05/05   Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)  Sum(DailyOut)

...

Can I do this in the fx button under column and field? or do elsewhere?

ordering route group - 20180619.png

1 Reply
ChennaiahNallani
Contributor III

Re: Columns ordering in pivot table

go with a custom sort

match(RouteGroup,'RouteGroup2 ',' RouteGroup1',' RouteGroup4','RouteGroup3)

Community Browser