Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Table Not Sorting Correctly

I can get the straight table to sort correctly on the start date but the pivot table (the one that I want) will not.  I've also tried to use the Top field in the expression but still doesn't work.  Can someone help with this?

Sort by...

Prospect (A-Z)

Pad (A-Z)

Well  (A-Z)

Wellbore (either Start date or Top depth)

Table Sorting.PNG

Thanks,

Mindy

1 Solution

Accepted Solutions
Not applicable
Author

Found a workaround.....

1st - created a Seq# field in the Wellbore table.

Left Join (Wellbore)
LOAD
  idwell as WellboreWellID,
  dttmstart as Wellbore_Section_Start_Dttm,
  WellboreSeq#;
SQL
  SELECT
      idwell,
      dttmstart,
      ROW_NUMBER() OVER (PARTITION BY idwell ORDER BY dttmstart ASC) AS WellboreSeq#
  FROM
      wv90.dbo.wvt_wvwellboresize

  GROUP BY
    idwell,
    dttmstart;

2nd - Put Seq# field in front of Wellbore field and "whited out" everything in that field.
Table Sorting Workaround.PNG

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Pivot tables are not "sort-friendly".  Looks like you want the "Wellbore" to be sorted differently for each "Well" value, but it does not work this way.  It will be sorted consistently the same way for all "Well" values.

Regards,

Michael

Not applicable
Author

That's what I figured but had hoped that maybe I was missing something.

Not applicable
Author

Found a workaround.....

1st - created a Seq# field in the Wellbore table.

Left Join (Wellbore)
LOAD
  idwell as WellboreWellID,
  dttmstart as Wellbore_Section_Start_Dttm,
  WellboreSeq#;
SQL
  SELECT
      idwell,
      dttmstart,
      ROW_NUMBER() OVER (PARTITION BY idwell ORDER BY dttmstart ASC) AS WellboreSeq#
  FROM
      wv90.dbo.wvt_wvwellboresize

  GROUP BY
    idwell,
    dttmstart;

2nd - Put Seq# field in front of Wellbore field and "whited out" everything in that field.
Table Sorting Workaround.PNG