COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Query Studio => Topic started by: okh310 on 13 Jul 2015 02:50:52 PM

Title: Indentation and sorting in a list report
Post by: okh310 on 13 Jul 2015 02:50:52 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: Indentation and sorting in a list report
Post by: bdbits on 13 Jul 2015 05:15:53 PM
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: Indentation and sorting in a list report
Post by: okh310 on 14 Jul 2015 09:38:17 AM
Thank you BDBITS!  This suggestion worked perfectly.  I am able to add my indentation with my if then statement AND the sorting works correctly.
Title: Re: Indentation and sorting in a list report
Post by: bdbits on 14 Jul 2015 09:50:05 AM
You're welcome.  :D