Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Cross tab or table ?
nnish
Hi Guys,<br />
<br />
Am building a school report. And what to know what is easy to use. I am stuck in both the options Cross tab and the table / Grid . <br />
<br />
I have the following data .<br />
<br />
Subjects : These are dynamic there are 8-10 subjects which are added or deleted periodically . these come from the db. <br />
Number of classes : If the teacher goes to a class a entry is made .this is saved in the db. <br />
Classrooms : This is a list from the database <br />
<br />
History - Geography - Algebra - Geometry - Physics - Chemistry - Total Classes <br />
Class room1 - 2 - 1 - 2 - 1 - 1 - 1 - 9 <br />
Class room2 - 1 - 0 - 0 - 1 - 0 - 0 - 2 <br />
Class room3 - 1 - 1 - 2 - 1 - 1 - 0 - 6 <br />
Class room4 - 2 - 0 - 0 - 1 - 0 - 1 - 4<br />
Class room5 - 1 - 1 - 2 - 1 - 1 - 0 - 6<br />
Class room6 - 0 - 0 - 0 - 0 - 1 - 0 - 1 <br />
<br />
<strong class='bbc'><br />
Total - 8 - 3 - 6 - 5 - 5 - 2 - 28 </strong><br />
<br />
Can some one give me an example. <br />
<br />
I had pm the admin . But i guess he was too busy . It would be great if some one can post an example.<br />
<br />
All the data will be loaded from the data base. Is a cross tab better here or a grid ?<br />
<br />
Thanks in advance .
Find more posts tagged with
Comments
mwilliams
Hi nnish,
It sounds like a crosstab would be the best for this. How is your data set up? Is it like:
Classroom, Subject, Classes
Classroom1, History, 2
Classroom1, Geography, 1
etc...
If so, a crosstab with dimensions for classroom and subject, and then use classes as the measure should get you what you're wanting. The row and column dimensions would expand to meet the amount of classrooms and subjects. You can even add a total row and column. Let me know if you have questions.
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67673" data-time="1282652077" data-date="24 August 2010 - 05:14 AM"><p>
Hi nnish,<br />
<br />
It sounds like a crosstab would be the best for this. How is your data set up? Is it like:<br />
<br />
Classroom, Subject, Classes<br />
Classroom1, History, 2<br />
Classroom1, Geography, 1<br />
etc...<br />
<br />
If so, a crosstab with dimensions for classroom and subject, and then use classes as the measure should get you what you're wanting. The row and column dimensions would expand to meet the amount of classrooms and subjects. You can even add a total row and column. Let me know if you have questions.<br /></p></blockquote>
<br />
Thanks for the info. <br />
<br />
I tried cross but it got me confused. <br />
<br />
I have 3 tables from where data is coming in all the values are dynamic and can change periodically. <br />
<br />
Table no.1 saves class room names <br />
Table no.2 saves the subject names<br />
Table no.3 saves the classes what the teachers have attended or taken. <br />
<br />
is there a similar example. I got one example but many header values are hard coded.
nnish
I figured this out . It was simple.
Got it working . Thanks .
But i wanted to know how can i add one more column for total at the end of the cross tab ?
and want to add one row to give the total count of all the number of classes.
mwilliams
In your design window, you'll see a little icon next to the dimension. If you click on that, you'll get the option to add grand totals.
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67751" data-time="1282747312" data-date="25 August 2010 - 07:41 AM"><p>
In your design window, you'll see a little icon next to the dimension. If you click on that, you'll get the option to add grand totals.<br /></p></blockquote>
<br />
I figured this too. It worked flawlessly . <br />
<br />
Now the last hurdle. <br />
I want to make this a weekly report . Can you guide me how this can be done ? <br />
<br />
I got the report parameter part Added a "from" and "to". Is there a way i can get all the weekdays dynamically in the cross tab Say sunday to Friday ?
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67751" data-time="1282747312" data-date="25 August 2010 - 07:41 AM"><p>
In your design window, you'll see a little icon next to the dimension. If you click on that, you'll get the option to add grand totals.<br /></p></blockquote>
<br />
<br />
I got the report parameter part Added a "from" and "to". Is there a way i can get all the weekdays dynamically in the cross tab Say sunday to Friday ? and filter it . i am trying the inbuilt functions but cant figure it out .<br />
<br />
If i choose 2 dates i want to get all the weekdays between those dates. Is there any example of this kind .
mwilliams
So, you have a "from" and a "to" parameter value? If so, you can just limit your data that you bring in with these values. Since a crosstab is dynamic, it will adjust its rows/columns based on the data available.
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67848" data-time="1282918520" data-date="27 August 2010 - 07:15 AM"><p>
So, you have a "from" and a "to" parameter value? If so, you can just limit your data that you bring in with these values. Since a crosstab is dynamic, it will adjust its rows/columns based on the data available.<br /></p></blockquote>
<br />
This is working . <br />
<br />
How do i get the weekdays dynamically . Say Sunday to Friday or Monday to Sunday in the cross tab ?
mwilliams
If one of your dimensions is a date, you should be able to use the auto grouping to do group by year/month/day/etc. The default is going to be Sunday - Saturday. Hope this helps.
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67903" data-time="1283180110" data-date="30 August 2010 - 07:55 AM"><p>
If one of your dimensions is a date, you should be able to use the auto grouping to do group by year/month/day/etc. The default is going to be Sunday - Saturday. Hope this helps.<br /></p></blockquote>
<br />
Cool. It worked . <br />
The cross tabs are actually very simple . just need to spend some time on it . <br />
<br />
mwilliams i am not able to add text in the cross tab is it possible ?<br />
<br />
I am trying to create a cross tab like the one below<br />
<br />
<br />
saturday - sunday - monday - tuesday - wednesday - thursday <br />
number of classes 10-21-31-3-14-51-23<br />
number of subjects 2-4-2-3-5-12-3 <br />
<br />
the weekdays and the count are all coming from the cross tab how can i add my own value ie the number of classes and number of subjects ?? <br />
<br />
Birt reports is really awesome . Thanks a ton mwilliams and the team for adding good tutorials and information in the forum..
mwilliams
You are very welcome. Always let us know whenever you have questions!
I'm not completely sure what you're having a problem with. Is it with having the labels "number of..."? Or is it how to compute the data? Or is it all of the above? Let me know. Also, let me know what your data for this looks like so I can figure out how you'll have to go about this.
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67999" data-time="1283353199" data-date="01 September 2010 - 07:59 AM"><p>
You are very welcome. Always let us know whenever you have questions!<br />
<br />
I'm not completely sure what you're having a problem with. Is it with having the labels "number of..."? Or is it how to compute the data? Or is it all of the above? Let me know. Also, let me know what your data for this looks like so I can figure out how you'll have to go about this.
<br /></p></blockquote>
<br />
The computing is fine . I have a problem with getting the label. "number of classes" Can it be hardcoded in some or the other way . <br />
<br />
the weekdays are coming properly the data is coming properly . Just want to add the label in the first column.
mwilliams
I don't know how your data is, so I'm not sure exactly how to suggest to do this. Can you post a small, dummy sample of your data?
nnish
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68062" data-time="1283436370" data-date="02 September 2010 - 07:06 AM"><p>
I don't know how your data is, so I'm not sure exactly how to suggest to do this. Can you post a small, dummy sample of your data?<br /></p></blockquote>
<br />
Mwilliams this is a different issue . <br />
<br />
See the number of classes and number of students attended I want them to come in the cross tab . <br />
My data is as follows<br />
<br />
<strong class='bbc'>Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday <br />
</strong><strong class='bbc'>Number of classes,</strong> 18,12,16,25,22,11, <br />
<strong class='bbc'>Number of students attended</strong>,43,21,14,23,31,11, <br />
<br />
The weekdays i want it to be common for all the rows . how can i add the number of classes and number of <br />
students attended ? I have attached a screen shot its in excel thats exactly what i am trying for. <br />
<br />
Any suggestions.
mwilliams
nnish,
Sorry, I understand what you're trying to do, but I just want to know exactly what your data looks like so I can see if I can find a way to approach this. If you can show a small sample of your dataSet, that'd be great! Thanks!
joseflores
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68196" data-time="1283886372" data-date="07 September 2010 - 12:06 PM"><p>
nnish,<br />
<br />
Sorry, I understand what you're trying to do, but I just want to know exactly what your data looks like so I can see if I can find a way to approach this. If you can show a small sample of your dataSet, that'd be great! Thanks!<br /></p></blockquote>
<br />
HI Williams, What if i would like to add empty lines between details from the crosstab?
joseflores
<blockquote class='ipsBlockquote' data-author="'joseflores'" data-cid="71120" data-time="1291743904" data-date="07 December 2010 - 10:45 AM"><p>
HI Williams, What if i would like to add empty lines between details from the crosstab?<br /></p></blockquote>
<br />
I mean between grouped details
mwilliams
So, you'd like an empty line between each grouping? Like if you had:
Continent | Country || 2008 | 2009 | 2010
NA | USA | 1 | 2 | 4
___ | CA | 2 | 3 | 4
EU | FR | 0 | 1 | 1
__ | SP | 1 | 1 | 2
You'd like to see that as:
Continent | Country || 2008 | 2009 | 2010
NA | USA | 1 | 2 | 4
___ | CA | 2 | 3 | 4
EU | FR | 0 | 1 | 1
__ | SP | 1 | 1 | 2
??
If so, you could use an outer list or table to list the continents, then embed a crosstab into this outer element and filter it to the outer element's value. You could then add a dummy text/grid/label element to give you a space between the groupings that would be done by the outer element. Let me know if this doesn't make sense.
I'll try to explain better.
joseflores
Excelent Williams!!<br />
Now this leads me to second question:<br />
<br />
I have a report of sales per region/dates (Year, Month, etc).<br />
I did what you told. Now how can I make all crosstabs details to have the same columns no matter they are no data for a region/date and have only on header - no one per crosstab - that reflects the report options selected?<br />
<br />
Regards,<br />
Jose<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="71123" data-time="1291744852" data-date="07 December 2010 - 11:00 AM"><p>
So, you'd like an empty line between each grouping? Like if you had:<br />
<br />
Continent | Country || 2008 | 2009 | 2010<br />
NA | USA | 1 | 2 | 4<br />
___ | CA | 2 | 3 | 4<br />
EU | FR | 0 | 1 | 1<br />
__ | SP | 1 | 1 | 2<br />
<br />
<br />
You'd like to see that as:<br />
<br />
Continent | Country || 2008 | 2009 | 2010<br />
NA | USA | 1 | 2 | 4<br />
___ | CA | 2 | 3 | 4<br />
<br />
EU | FR | 0 | 1 | 1<br />
__ | SP | 1 | 1 | 2<br />
<br />
<br />
??<br />
<br />
If so, you could use an outer list or table to list the continents, then embed a crosstab into this outer element and filter it to the outer element's value. You could then add a dummy text/grid/label element to give you a space between the groupings that would be done by the outer element. Let me know if this doesn't make sense.
I'll try to explain better.<br /></p></blockquote>
mwilliams
Jose,
For them to all have the same columns, you'd probably need to know all the possible column values and make a dataSet with these in them, then you'd need to join your dataSet with these values so that the column value was present for every group value. You'll want to make sure you have your crosstab set up so that null or empty cells are shown. As for hiding the headers, you should be able to make the "display" setting in the "section" section of the "advanced" properties in the property editor, to "no display" on the headers you don't want to show.
Hope this helps.