COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Seveman on 15 Mar 2017 07:41:02 AM

Title: Problem sorting bars in bar graph
Post by: Seveman on 15 Mar 2017 07:41:02 AM
Hi folks,

I ahve this problem. I have a graph that is supposed be updated to show monthly values for number of customers. The series are month, previous year month and target for the month. Month values are bars and target values are line. As of now, the graph is sorted showing the previous year values first and is supposed to be sorted so that current year month bar is on the left and previous year month is on the right. I seem not to be able to have the bars sorted the way I want them.
So far, I`ve tried sorting x-axis, making a set of the years and sorting the set, sorting the Y-nodes, deleting the py values and inserting again but nohting works. Any ideas?
Title: Re: Problem sorting bars in bar graph
Post by: Invisi on 15 Mar 2017 10:15:28 AM
Make a sorting data item that contains 1, 2 or 3 for the corresponding value? Or maybe I should ask first: how is your data structured?
Title: Re: Problem sorting bars in bar graph
Post by: Seveman on 15 Mar 2017 12:22:58 PM
Hi,
the structure is:
Measures "Real", "Target"
Dimensions:
"Time" normal time dimension with year, trimester, and month of which there is a data item that filters for current year and current month as well as previous year and previous month
"Indicator" a dimension that allows to select if you want to see sales, # of customers, expenses, etc.

So the data in the graph is:
data item "current year" = total [real] within set [current year]
data item "py year" = total [real] within set [current year]
data item "months" = months in time dimension
data item "target" = total [target] within set [current year]
data item "month number" = month number property of the month

Series (in order top down): "current year" (bar), "py year" (bar), target (line)
Categories "months"
sorting of category item "months" = "month number" so the months are shown in their order.


Title: Re: Problem sorting bars in bar graph
Post by: Seveman on 15 Mar 2017 01:37:34 PM
Attaching images to make it clearer

Thanks
Title: Re: Problem sorting bars in bar graph
Post by: Seveman on 16 Mar 2017 07:21:17 AM
Hi,
I solved the issue creating a new data item that contains the year and including the iten in the sorting property of the category (x axis) after the month sort so that the graph is sorting the bars by month first and then by the year.
Thanks Invisi.