martes, 23 de junio de 2015

Repeat name of group in crosstab

I had a request for a report that invoved to have store sales by item and day for the past week. The straightforward solution to that is to have a crosstab, set the date column, items, group by store and sales as measure. So far so good. the problem is, the user wanted the stor name repeated for each item sold.
Right off the bat, the crosstab (and a list with group) would only show the group item (the store) once. so I went out looking for a solution. The solution with a different example but worked for me was found here
http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/crosstab-report-repeat-name-within-a-group-3198995

and you can read it here with some graphics and comments of my ownn thrown in:




If I understand, your rows show Country, City, Month and you want City to repeat.

From my example, standard crosstab

and standard result


Drag all three on as you normally would so that they're in the query. Drag Month on a SECOND time, probably between City and Month.
Step 1. Repeat column

Unlock the report.

Click on the word Month in the new month column. Change the Source Type property to Data Item Value.
 Change the Data Item value property to City. 




Lock the report back up. Cut the original City column.



I believe what's happening is that it knows to repeat each month so that's making the cell repeat but you're overriding the data in that cell with the City