Thread: Cross tab report vertical display?

This question is answered.


Permlink Replies: 9 - Pages: 1 - Last Post: Dec 9, 2009 9:49 AM Last Post By: user10597210
user10597210

Posts: 48
Registered: 12/03/08
Cross tab report vertical display?
Posted: Nov 14, 2009 2:48 PM
 
Click to report abuse...   Click to reply to this thread Reply
Is it possible for a cross tab (or other RTF template report format) to accomplish this?

The one issue with our cross tab report is the data needs to be grouped by day. This is the format we would like to achieve:

Employee-----Mon-----------Tues-------------Wed
John------------08:15AM-----08:15AM------11:00AM
------------------12:15PM-----08:15AM------16:00PM
------------------01:15PM-----08:15AM------17:00PM
------------------17:30PM-----08:15AM------19:30PM
Mary-----------10:00AM-----08:15AM------10:00AM
------------------14:15PM-----11:15AM------14:15PM
------------------15:15PM-----12:15AM------15:15PM
------------------19:30PM-----17:15AM------19:30PM

In this way, each employee (John and Mary) shows the time they started work and below that the time they went on their lunch break below that the time back from lunch break and below that the time they finished work.

With a cross tab report we are getting these results:

Employee-----Mon-----------Tues-------------Wed-----------Thurs
John------------08:15AM-----12:15PM------01:15PM------17:30PM
Mary-----------10:00AM-----14:15PM------ 15:15PM-------19:30PM

The data is going across the row instead of down. John's 12:15PM time going to lunch should display directly below the 08:15AM time he started work as in the first example.

Any suggestions to get a cross tab report (or any other kind of format) to display data like that?

Thank you very much! :)

Tim Dexter

Posts: 2,357
Registered: 01/10/01
Re: Cross tab report vertical display?
Posted: Nov 15, 2009 1:20 PM   in response to: user10597210 in response to: user10597210
 
Click to report abuse...   Click to reply to this thread Reply
Can you share some of the data you have and the version you are running?

thanks

Tim
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Nov 15, 2009 3:43 PM   in response to: Tim Dexter in response to: Tim Dexter
 
Click to report abuse...   Click to reply to this thread Reply
We are working with XML Publisher (built into PeopleTools in PeopleSoft CRM 9. Tools 8.49.0.4. The XML is created from a PeopleSoft query (in App Designer) and looks like this:

<?xml version="1.0" ?>
- <query numrows="10" queryname="XML_QUERY1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="">
- <row rownumber="1">
<PKT_POST_ID>PKT_POST_I</PKT_POST_ID>
<PKT_CHECKIN_TYPE>P</PKT_CHECKIN_TYPE>
<EMPLID>EMPLID samp</EMPLID>
<ROW_ADDED_DTTM>2009-11-09T16:52:55-05:00</ROW_ADDED_DTTM>
<ACTIVITY_CODE>ACTIVITY</ACTIVITY_CODE>
<PHONE>PHONE sample data</PHONE>
<DESCR80>DESCR80 sample data</DESCR80>
<PKT_RC_NUMBER>PKT_RC_NUM</PKT_RC_NUMBER>
<DESCR50>DESCR50 sample data</DESCR50>
<DESCR>DESCR sample data</DESCR>
<COMPANYID>COMPANYID sampl</COMPANYID>
<BO_NAME>BO_NAME sample data</BO_NAME>
<BO_NAME_1>BO_NAME_1 sample data</BO_NAME_1>
<ADDRESS1>ADDRESS1 sample data</ADDRESS1>
<CITY>CITY sample data</CITY>
<STATE>STATE</STATE>
<EXP17_44>EXP17_44 sample</EXP17_44>
<EXP18_40>EXP18_40 sample</EXP18_40>
<EXP12_52>EXP12_52 sample</EXP12_52>
<EXP9_52>EXP9_52 sample</EXP9_52>
<EXP11_164>EXP11_164 sampl</EXP11_164>
</row>
- <row rownumber="2">
<PKT_POST_ID>PKT_POST_I</PKT_POST_ID>
<PKT_CHECKIN_TYPE>P</PKT_CHECKIN_TYPE>
<EMPLID>EMPLID samp</EMPLID>
<ROW_ADDED_DTTM>2009-11-09T16:52:55-05:00</ROW_ADDED_DTTM>
<ACTIVITY_CODE>ACTIVITY</ACTIVITY_CODE>
<PHONE>PHONE sample data</PHONE>
<DESCR80>DESCR80 sample data</DESCR80>
<PKT_RC_NUMBER>PKT_RC_NUM</PKT_RC_NUMBER>
<DESCR50>DESCR50 sample data</DESCR50>
<DESCR>DESCR sample data</DESCR>
<COMPANYID>COMPANYID sampl</COMPANYID>
<BO_NAME>BO_NAME sample data</BO_NAME>
<BO_NAME_1>BO_NAME_1 sample data</BO_NAME_1>
<ADDRESS1>ADDRESS1 sample data</ADDRESS1>
<CITY>CITY sample data</CITY>
<STATE>STATE</STATE>
<EXP17_44>EXP17_44 sample</EXP17_44>
<EXP18_40>EXP18_40 sample</EXP18_40>
<EXP12_52>EXP12_52 sample</EXP12_52>
<EXP9_52>EXP9_52 sample</EXP9_52>
<EXP11_164>EXP11_164 sampl</EXP11_164>
</row>
</query>

I can send you the RTF template too. Thank you!
Vetsrini

Posts: 2,789
Registered: 07/24/06
Re: Cross tab report vertical display?
Posted: Nov 15, 2009 9:11 PM   in response to: user10597210 in response to: user10597210
Helpful
Click to report abuse...   Click to reply to this thread Reply
you have to put the loop, without @column...
remove the @column from the cell..

or do send me the xml and template,id is in my profile.
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Nov 16, 2009 8:50 AM   in response to: Vetsrini in response to: Vetsrini
 
Click to report abuse...   Click to reply to this thread Reply
Removing the @column created a single column with the same day listed. No other day columns were created.

I sent you the RTF and XML. Thank you. :)

Edited by: user10597210 on Nov 17, 2009 11:55 AM
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Nov 18, 2009 9:46 AM   in response to: user10597210 in response to: user10597210
 
Click to report abuse...   Click to reply to this thread Reply
I have clarified the XML a bit more here:

- <row rownumber="1">
<EMPL_NAME>John</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>08:15</TIME>
</row>
- <row rownumber="2">
<EMPL_NAME>John</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>12:15</TIME>
</row>
- <row rownumber="3">
<EMPL_NAME>John</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>13:15</TIME>
</row>
- <row rownumber="4">
<EMPL_NAME>John</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>17:30</TIME>
</row>
- <row rownumber="5">
<EMPL_NAME>Mary</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>10:00</TIME>
</row>
- <row rownumber="6">
<EMPL_NAME>Mary</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>14:15</TIME>
</row>
- <row rownumber="7">
<EMPL_NAME>Mary</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>15:15</TIME>
</row>
- <row rownumber="8">
<EMPL_NAME>Mary</EMPL_NAME>
<DAY>Wednesday</DAY>
<DATE>11/18/2009</DATE>
<TIME>19:30</TIME>
</row>

Ideally, the display would look like this:

Employee-----Monday---------Tuesday---------Wednesday
------------------11/16/2009---11/17/2009-----11/18/2009
John------------08:15------------08:15--------------11:00
------------------12:15------------08:15--------------16:00
------------------01:15------------08:15--------------17:00
------------------17:30------------08:15--------------19:30
Mary-----------10:00-------------08:15--------------10:00
------------------14:15------------11:15--------------14:15
------------------15:15------------12:15--------------15:15
------------------19:30------------17:15--------------19:30

And if a time cell has no data just leave that time cell blank.

Thank you for any information.
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Nov 19, 2009 3:53 PM   in response to: user10597210 in response to: user10597210
 
Click to report abuse...   Click to reply to this thread Reply
Update: The cross tab now displays like this:

Employee-----Monday---------Tuesday---------Wednesday
------------------11/16/2009---11/17/2009-----11/18/2009
John------------08:15------------08:15--------------11:00
Mary-----------10:00-------------08:15--------------10:00

Thank you Vetsrini for the great sample on this page:

http://winrichman.blogspot.com/2008/08/cross-tabs-problem-with-grouping-and.html

However, there is only a single row for each employee for each day. The cross tab only displays the time they started work. What does not display is the time they went to lunch, came back from lunch and time they finished work. The display below is the requirement for this report.

Employee-----Monday---------Tuesday---------Wednesday
------------------11/16/2009---11/17/2009-----11/18/2009
John------------08:15------------08:15--------------11:00
------------------12:15------------08:15--------------16:00
------------------01:15------------08:15--------------17:00
------------------17:30------------08:15--------------19:30
Mary-----------10:00-------------08:15--------------10:00
------------------14:15------------11:15--------------14:15
------------------15:15------------12:15--------------15:15
------------------19:30------------17:15--------------19:30

Getting closer, just need to figure out how to get to this last step.

Thank you very much for any advice!
Tim Dexter

Posts: 2,357
Registered: 01/10/01
Re: Cross tab report vertical display?
Posted: Nov 20, 2009 11:34 AM   in response to: user10597210 in response to: user10597210
Correct
Click to report abuse...   Click to reply to this thread Reply
OK, I got it, little bit of hacking and I got the output you wanted ... old skool crosstabbing

!http://blogs.oracle.com/xmlpublisher/images/CTab2.jpg!

Fields are

!http://blogs.oracle.com/xmlpublisher/images/CTab3.jpg!

Will write this up for a blog posting next week ...

RTF template available here, [http://blogs.oracle.com/xmlpublisher/files/ToughCrossTab.rtf]

Tim
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Dec 2, 2009 1:26 PM   in response to: Tim Dexter in response to: Tim Dexter
 
Click to report abuse...   Click to reply to this thread Reply
This woks great! Thanks for your help!
user10597210

Posts: 48
Registered: 12/03/08
Re: Cross tab report vertical display?
Posted: Dec 9, 2009 9:49 AM   in response to: user10597210 in response to: user10597210
 
Click to report abuse...   Click to reply to this thread Reply
Taking this idea a bit further we needed to embed an old skool cross tab table inside an RTF template with a few grouping layers above it. Adding variables and a sort helped a lot. Here is what the RTF code looks like:

ABOVE WORD TABLE:
<?for-each-group@section:row;./FIELD1?>
INSIDE WORD TABLE:
WORD TABLE ROW 1: <?FIELD1?>
WORD TABLE ROW 2:<?for-each-group:current-group();./FIELD2?><?FIELD2?>
WORD TABLE ROW 3:<?for-each-group:current-group();./FIELD3?><?variable@incontext:G1;current-group()?><?FIELD3?>
WORD TABLE ROW 4:
EMBEDDED CROSS TAB TABLE:
Cell 1,1: Employee (text column heading)
Cell 1,2: <?for-each-group@column:current-group();./DATE?><?sort:DATE?><?DATE?><?end for-each-group?>
Cell 2,1: <?for-each-group:current-group();./NAME?><?variable@incontext:EMP;NAME?><?NAME?>
Cell 2,2:<?for-each-group@cell:$G1;DATE?><?sort:DATE?> <?for-each-group:current-group();./TIME?><?if:count(current-group()[NAME=$EMP])?><?(current-group()[NAME=$EMP]/TIME)?><?end if?><?end for-each?><?end for-each-group?><?end for-each-group?>
OUTSIDE EMBEDDED CROSS TAB TABLE:
<?end for-each-group?>
BELOW OUTER WORD TABLE:
<?end for-each-group?>
<?end for-each-group?>
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums