SSRS :Sorting problem in column group
Hi
Hope some one can help me solving this problem.It seems small but seems not easy.. I have created data table column called data item . Data item column creates many columns depends row values . .
id dataitem dataitem val
1 overall red
1 lifecycle gree
2 overall green
2 lifecycle red
3 over ... red
3 life ... orange
it was converted in to report
proj id overall lifecycle
1 red green
2 green red
3 red orange
after it created columns overall.. . i want to sort overall status column red, green , organe.. like that. Please can some one help me.
September 28th, 2011 11:01am
Hi there,
You can do this a few ways.
1. Create a function in the report that returns a sort index based on the color passed in. Add this as a sort expression.
2. Add a sort expression with nested IF statement. Return numeric sort values.
3. Add a dataset similar to the following. Lookup the value from the dataset. (SQL 2008)
select 3 as sortid, 'Orange' as key
UNION ALL
select 1 as sortid, 'Red' as key
UNION ALL
select 2 as sortid, 'Green' as key
4. Join on this query in your original dataset. (SQL 2005/2008)
select *, sortid from myquery
left outer join (
select 3 as sortid, 'Orange' as sortkey
UNION ALL
select 1 as sortid, 'Red' as sortkey
UNION ALL
select 2 as sortid, 'Green' as sortkey) mysorts on mysorts.sortkey= dataitem.val
cheers,
AndrewAndrew Sears, T4G Limited, http://www.performancepointing.com
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2011 11:52am
Dear Andrew,
Thanks for your reply....but i tried solution 4 but its failed my data set as follows
Programme Portfolio ProjectName PortfolioId CatDisplayName DisplayOrder CatType DataValue IsNPMF
SORTID
Applications 4. ICT Contact Upgrade 15 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT Crime Information Service 16 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT Delivering the New Website 18 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT Firewall Replacement 20 Lifecycle 2 Ind 1. Request 0 NULL
Infrastructure 4. ICT Hosting Proof of Concept (PoC) 21 Lifecycle 2 Ind 5. Close 0 NULL
Applications 4. ICT Information Security (Phase 2) 22 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT Legal Case Management System 24 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT MS SharePoint Installation and Roll-Out 25 Lifecycle 2 Ind 1. Request 0 NULL
Infrastructure 4. ICT Search (Autonomy) 29 Lifecycle 2 Ind 1. Request 0 NULL
Applications 4. ICT Contact Upgrade 15 Overall 1 Ind Red 0 1
Applications 4. ICT Information Security (Phase 2) 22 Overall 1 Ind Red 0 1
Applications 4. ICT Legal Case Management System 24 Overall 1 Ind Red 0 1
Applications 4. ICT MS SharePoint Installation and Roll-Out 25 Overall 1 Ind Red 0 1
Applications 4. ICT Contact Upgrade 15 Cost 3 Ind Red 0 1
Applications 4. ICT Information Security (Phase 2) 22 Risk/Issue 5 Ind Red 0 1
Applications 4. ICT Legal Case Management System 24 Risk/Issue 5 Ind Red 0 1
Applications 4. ICT Information Security (Phase 2) 22 Schedule 4 Ind Red 0 1
Applications 4. ICT Legal Case Management System 24 Schedule 4 Ind Red 0 1
Applications 4. ICT Information Security (Phase 2) 22 Cost 3 Ind Red 0 1
Applications 4. ICT MS SharePoint Installation and Roll-Out 25 Cost 3 Ind Red 0 1
Infrastructure 4. ICT Search (Autonomy) 29 Schedule 4 Ind Green 0 2
Applications 4. ICT Crime Information Service 16 Schedule 4 Ind Green 0 2
Applications 4. ICT Delivering the New Website 18 Schedule 4 Ind Green 0 2
Applications 4. ICT Firewall Replacement 20 Schedule 4 Ind Green 0 2
Infrastructure 4. ICT Hosting Proof of Concept (PoC) 21 Schedule 4 Ind Green 0 2
Infrastructure 4. ICT Search (Autonomy) 29 Risk/Issue 5 Ind Green 0 2
Applications 4. ICT Crime Information Service 16 Risk/Issue 5 Ind Green 0 2
Applications 4. ICT Delivering the New Website 18 Risk/Issue 5 Ind Green 0 2
Applications 4. ICT Firewall Replacement 20 Risk/Issue 5 Ind Green 0 2
Infrastructure 4. ICT Hosting Proof of Concept (PoC) 21 Risk/Issue 5 Ind Green 0 2
Applications 4. ICT Crime Information Service 16 Cost 3 Ind Green 0 2
Applications 4. ICT Delivering the New Website 18 Cost 3 Ind Green 0 2
Applications 4. ICT Firewall Replacement 20 Cost 3 Ind Green 0 2
Infrastructure 4. ICT Hosting Proof of Concept (PoC) 21 Cost 3 Ind Green 0 2
Applications 4. ICT Crime Information Service 16 Overall 1 Ind Green 0 2
Applications 4. ICT Delivering the New Website 18 Overall 1 Ind Green 0 2
Applications 4. ICT Firewall Replacement 20 Overall 1 Ind Green 0 2
Infrastructure 4. ICT Hosting Proof of Concept (PoC) 21 Overall 1 Ind Green 0 2
Infrastructure 4. ICT Search (Autonomy) 29 Overall 1 Ind Amber 0 3
Applications 4. ICT Contact Upgrade 15 Schedule 4 Ind Amber 0 3
Applications 4. ICT MS SharePoint Installation and Roll-Out 25 Risk/Issue 5 Ind Amber 0 3
Applications 4. ICT Contact Upgrade 15 Risk/Issue 5 Ind Amber 0 3
Applications 4. ICT MS SharePoint Installation and Roll-Out 25 Schedule 4 Ind Amber 0 3
Infrastructure 4. ICT Search (Autonomy) 29 Cost 3 Ind Amber 0 3
Applications 4. ICT Legal Case Management System 24 Cost 3 Ind Amber 0
those above data set show as column overall....lifecyle .
i have used sorting expression sortid but its failed.. plz help me any other solution
Thanks
September 29th, 2011 7:21am