COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: okh310 on 13 Jul 2015 02:59:45 PM

Title: Column indentation and sorting in a list report
Post by: okh310 on 13 Jul 2015 02:59:45 PM
Hello - I have a list report with a column for task names.  These task names have a WBS number that can be 1, 1.1, 1.1.3 etc.

1=level 1
1.1=level 2
1.1.2=level 3 etc.

I want the task name column to indent based on the level.  I can manually code this with an if then statement and adding spaces in front of the task name.  However, when I go to sort the column, it picks up the spaces in front of the task name so it doesn't sort correctly.

Is anyone aware of a way to do this and get the sorting to work properly?  Is there built in functionality I'm missing?  I know you can do this easily in a crosstab, but not a list report.

Thanks,
Title: Re: Column indentation and sorting in a list report
Post by: Michael75 on 14 Jul 2015 01:28:02 AM
Include both your task name (unedited) AND your task name with leading spaces in your list. Do your sorting on the former, then Cut (not Delete) it from the layout.
Title: Re: Column indentation and sorting in a list report
Post by: okh310 on 14 Jul 2015 09:40:23 AM
Thanks Michael, great idea and works!

Another user suggested the following which also works:

Change your "WBS number" back to the column value, no expression. Now select that data item on the list. Under properties, under Text Source, change Source Type to Report Expression. Put your if or case to add spaces in the expression editor, click OK. Run the report.
Title: Re: Column indentation and sorting in a list report
Post by: Michael75 on 14 Jul 2015 11:21:33 AM
You're welcome.   ;D

Normally, double-posting on different boards in Cognoise is frowned upon, but today's your lucky day. Not only have you escaped a slap on the wrist, but you've received two working solutions to your problem :)
Title: Re: Column indentation and sorting in a list report
Post by: okh310 on 14 Jul 2015 11:27:03 AM
I noticed that I posted in QS at first and I couldn't figure out how to delete it and repost it in RS.  So I posted twice.  My apologies and thanks again for the suggestion :)
Title: Re: Column indentation and sorting in a list report
Post by: Cheeks100 on 30 Jan 2018 10:49:38 PM
Hi I am working with a relational DB with a WBS as above.  I only have costs at the lowest level of the WBS leg.  I want to sum this up through the heirarchy.

Anybody any ideas how to do this.  There is a parent / child heir achy table for the WBS.

Any help would be much appreciated

Title: Re: Column indentation and sorting in a list report
Post by: dougp on 31 Jan 2018 02:32:23 PM
You can also create a depth column (by counting the periods in the WBS number?) and use conditional formatting applying a value for padding or margin.  But that may be tedious to set up, especially if you don't know what the maximum depth may be.  (It doesn't look like the property values  can be parameterized.)