1. Marco Meoni
  2. PowerBuilder
  3. Wednesday, 06 June 2018

Hi folks,

any idea on how to get column indices in a crosstab DW?

Say you have a crosstab showing products on the rows and delivery dates on the columns, with whatever values on the cells.

How would you set the cell backcolor to e.g. RED if sunday and WHITE if not? Or, to make it simpler, how to set RED only at cells with index 7, 14, 21....

Best,

Marco 

0
Votes
Undo

HI Marcus

Personally I would not use a crosstab DW. I would either use a N column DW or generate my own columns across the DW to suit and then you have full control.

Either way its never that nice to code but at least you will be sure that it will work.

In my experience crosstabs (in any language) tend to fall like a deck of cards when you touch them so maintenance is a pain afterward.

Sorry that it's not a lot of help nor does it answer you question, but hopefully it will save you time thinking about using a crosstab.

All the best

David

Comment
There are no comments made yet.
  1. Thursday, 7 June 2018
  2. PowerBuilder
  3. # 1
Markus Eckert Accepted Answer Pending Moderation
0
Votes
Undo

Hi Marco

For that specific example, I'd suggest you create a static crosstab (uncheck "Rebuild columns at runtime" when creating the DW)

You'll end up with a DW with 7 columns which you can then individually modify.

Unfortunately I have no idea how you can do it with a dynamic crosstab.

Regards,
Markus

Comment
Hi Markus,

columns are not limited to 7, as they are automatically exploded by the crosstab between two date arguments, startdate and enddate.

Best,

.m

  1. Marco Meoni
  2. Thursday, 7 June 2018
So your DW will have x columns, where x is the number of days between startdate and enddate?



One option I've found would be to programatically switch your DW between static and dynamic mode.



before retrieval: dw.modify('datawindow.crosstab.staticmode=no')

after retrieval: dw.modify('datawindow.crosstab.staticmode=yes')



Once you've switched it to static, you can get a list of your controls ( dw.describe ('datawindow.objects') ) and format them accordingly. You should be able to get the respective dates from the column headers.

  1. Markus Eckert
  2. Friday, 8 June 2018
There are no comments made yet.
  1. Thursday, 7 June 2018
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


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