Show results in columns vs rows

I need to have my results displayed in as many columns as the results need (the number of columns will vary depending on the record) instead of the rows the results are currently being written to.

Here's a sample resultset as it is dumped into rows:
ID          lname          fname          response          current
100       Doe               John             Mickey              Donald
100       Doe               John             Mickey              Tweety
100       Doe               John             Mickey              Daffy
100       Doe               John             Minnie              Pluto
100       Doe               John             Daffy                 Pluto

Here's what I need it to be:
ID       lname    fname    response1    response 2    current1   current2    current3
100    Doe         John      Mickey                                   Donald      Tweety      Daffy
100    Doe         John      Minnie           Daffy              Pluto

Or it can be like this:  (This way would be awesome!)
ID      lname      fname    response1   current1   response2    current2
100   Doe          John        Mickey         Donald     Minnie           Pluto
                                                                Tweety                             Daffy
                                                                Daffy                        

To complicate matters, the database this is being written against is Intersystems' Caché, which is FAR from SQL Server unfortunately, so I can't do temp tables, stored procs or other normal database stuff.
fcsITAsked:
Who is Participating?
 
lcohanConnect With a Mentor Database AnalystCommented:
Well I'm not expert for sure in Intersystems' Caché database coding/admin however according to this link http://www.intersystems.com/uk/library/library-item/introduction-to-deepsee-and-iknow-for-intersystems-campus/ there there is some training session on Pivot table right?

And what about this? it looks to me you can use DeepSee to do just that - Pivot right? is a BI tol provided by

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2GS_ch_intro
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=D2DT_ch_pivotetc

Besides that, In MySQL the "pivot" it's a two-step:

1. In an inner query, write one aggregating expression per reporting column,
2. In an outer query, build the horizontal sums:

and as Intersystems' Caché  supports SQL...that should do it right?
0
 
lcohanDatabase AnalystCommented:
Please see the basics from link below hopefully it will help to achieve the "pivot" function that you need as it looks like it supports SQL code :

http://www.artfulsoftware.com/infotree/qrytip.php?id=78

Worst case if none of us here can help I see "David E. Nelson" has some training session on "Creating DeepSee Models, Pivot Tables, Dashboards, and KPIs"
1
 
fcsITAuthor Commented:
Thank you Icohan, but unfortunately Intersystems' Caché doesn't support pivot.
0
 
fcsITAuthor Commented:
Well, what complicates this more is we inherited Caché when it came with a vended product.  That vendor doesn't allow us to do pretty much anything with Caché.  The vendor has blocked the areas in the System Management Portal that enable DeepSee.

Looks like I'm probably up the creek on this.  Sounds like I need to start building macros into a spreadsheet that can manipulate the data in its current form to make it what I need.

Gotta love these situations...

Thank you Icohan.  I appreciate your diligent help.
0
 
lcohanDatabase AnalystCommented:
"Sounds like I need to start building macros into a spreadsheet that can manipulate the data in its current form to make it what I need."
Can't you bring it in mySQL instead or any other database - even SQL Express if is not > 2GB and do it there instead? Maybe that's easier than Excel.

Also, "hat vendor doesn't allow us to do pretty much anything with Caché. The vendor has blocked the areas in the System Management Portal that enable DeepSee." - I would check if is not to dificult to see if this was done on purpose due to some licensing because if it does not require additional money then..you get the idea - is your right to use the product you paid for to FULL extent instead of bending backwards to reinvent something thats built in.
If is money related see maybe you can build a case to get it "unlocked" and utilized elsewhere as BI...must be useful to someone over there if they have the money to buy such product.


Good luck!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.