1. Steven Watkin
  2. PowerBuilder
  3. Thursday, 17 October 2024 18:28 PM UTC

Hello,

I have a crosstab datawindow that shows year-over-year data. The columns (values) are weekly totals for X number of weeks where X must be less than 52 so I can show multiple years with the same date range. The heading @end_week shows the month and day that the week ended.

For example if today is January 8, 2024, and the user wants to see the last 5 weeks for the previous 2 years, the report will show 5 columns: 12_11, 12-18, 12-25, 01-01, 01-08 with 2 rows: 2023 and 2024.

My problem is that Powerbuilder sorts the columns alphabetically: 01-01, 01-08, 12-11, 12-18, 12-25 even when I retrieve the data in chronological order. Is there a way to override this and sort the columns differently?

If there is no way to override it, I could possibly change the retrieved data as "(1) 12-11, (2) 12-18, (3) 12-25, (4) 01-01, (5) 01-08 but I prefer not to litter the report with extra data the user doesn't want to see.

Thank you,

Steven Watkins

 

 

 

 

 

 

 

John Fauss Accepted Answer Pending Moderation
  1. Thursday, 17 October 2024 22:16 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Steven -

The “dates” in the column headers do not include the year, but you are implying the year number when you read the column header text. The sort algorithms do not imply any meaning, they only sort using the data values as they are supplied. 

Try prefacing the mm-dd text with yyyy, as in 2023-12-25 and 2024-01-01.

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.