Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
d_koti24
Creator II
Creator II

Regarding Pivot Sorting

Hi All,

I Have pivot table like this:

sample_table:

ENV                DIR                                                SIZES(gb):

RAP                RAP_USER                                       200

                       RAP_TUSER                                     300

DEV               ....                                                      ....

UAT                ....                                                       ....

PROD             PROD ENV                                       150

LIKE this.

my req is i want to sort  like this

in env fied:

DEV

UAT

RAP

PROD

How to achive this?

Regards,

kd

1 Solution

Accepted Solutions
robert_mika
Master III
Master III

=if(match(Dir,' \\abghg\DEV','\\deh\DEV1','\\fgfgd\DATA','\\dgfgfgf\GM0100','sampleDEV01'),dual('DEV',1),

if(match(Dir,'\\MW1010\12000','\\jhjhjhjK\GMW','\\SDV064\GMTQT0101'),dual('RAP_ARCH',3),

if(match(Dir,'\\NA0063\GMTQT0099','DASHBOARDS','GBI','DASHBOARDSC'),Dual('PROD',4),

if(match(Dir,'DASHBOARDSUAT','GBIUAT'),Dual('UAT',2),dual('',5)))))

Feeling Qlikngry?

How To /Missing Manual(18 articles)

View solution in original post

19 Replies
robert_mika
Master III
Master III

cretae inline stat,ent in script

CusotmENV:

LOAD * INLINE

[
Line, Order
DEV,1

UAT,2

RAP,3

PROD,4
];


Then use this Order as Sort By Expression in your PT

d_koti24
Creator II
Creator II
Author

Hi Robert ,

Can you please send me the sample app.

regards,

kd

robert_mika
Master III
Master III

settu_periasamy
Master III
Master III

Hi,

One more  solution, if you want to do this in Expression Level,  try this

=Match(Line,'DEV','UAT','RAP','PROD')

1112.JPG

robert_mika
Master III
Master III

Good solution but if you got more values or your data set is quite large the script  way will be faster.

d_koti24
Creator II
Creator II
Author

Thanks for quick reply,

is there any chance with out using inline table.

my pivot table contains 3 dimensions and 4 exp.

regards,

kd

settu_periasamy
Master III
Master III

Hi,

did you try the match function (see my previous post)?

d_koti24
Creator II
Creator II
Author

ya.but i did nt get.

=IF(DIR='abDASHBOARDS','PROD',

IF(DIR='fgfgfgf','UAT',

IF(DIR='BIfgfg','PROD',

IF(DIR='sample','UAT',

IF(DIR='dfdfd','DEV',

IF(DIR='fdfd\AP','PROD',

IF(DIR='\\ssss','RAP_ARCH',

IF(DIR='\\aaa\dfdfd','RAP_ARCH',

IF(DIR='\\fff\fffffffff','RAP_ARCH')))))))))

this is my envr dimension.based on dir we are given that envr names.

i want to sort the pivot table based on first dimension. envr is the first dimension.

robert_mika
Master III
Master III

Could you move this calculated dimension to script?

This will speed up your calculation.

And then use the Match function?