Can I use multiple crosstab commands in the same resulset?
Multiple crosstab commands
(6 posts) (3 voices)-
-
What is it that you would like to do with multiple crosstab commands? How would the result look like?
--
myDBR Team -
I would like to group some columns of the resultset under a title. And I think having multiple crosstab commands would help to do that.
Lets say I have this table:PRODUCT ID COLOR WEIGHT ITEMS_SOLD ITEMS_RETURNED
I would like to give the columns (COLOR and WEIGHT) the tittle INFORMATION
and the columns(ITEMS_SOLD and ITEMS_RETURNED) the tittle SALES, so the information shown in the table is more understandable. So Using multiple crosstab commands can be used like this:select 'dbr.croostab',2,4;
select 'dbr.croostab',5,7;select PRODUCT ID,
'INFORMATION',
COLOR,
WEIGHT,
'SALES',
ITEMS_SOLD,
ITEMS_RETURNED FROM MY_TABLEBut this only works for the second command, so I get to group the 'SALES' but not the other one. I would like to know if there is any other way to do this.
-
What you are doing is not exactly crosstab but additional table header (crosstab just happens to do partly that when you apply it to a constant column). You could add extra table header row now with JavaScript, but we can add it as an feature request to be supported.
--
myDBR Team -
How to achieve it via javascript ?
-
myDBR includes dbr.javascript commnd which you can use to invoke a jQuery-call. You need to add a header row (tr) with th elements and suitable css classes.
--
myDBR Team
Reply
You must log in to post.