SSRS Group By Question
Hello
I am after a table which groups by 'Phase' e.g. first phase, second phase, third phase, fourth phase. This information is grabbed from SQL.
However, I am finding it groups in this order;
first phasefourth phasesecond phasethird phase
Is there a way of setting the order of group by, manually so to speak?
Hope this makes sense.
May 15th, 2012 7:07am
just give row group by condition.indu
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 7:18am
Hello
I am after a table which groups by 'Phase' e.g. first phase, second phase, third phase, fourth phase. This information is grabbed from SQL.
However, I am finding it groups in this order;
first phasefourth phasesecond phasethird phase
Is there a way of setting the order of group by, manually so to speak?
Hope this makes sense.
Hook This in Grouping and/or Sorting Expression :
=IIF(Fields!GroupFieldName.value="FirstPhase",1,IIF(Fields!GroupFieldName.value="FourthPhase",2,IIF(Fields!GroupFieldName.value="SecondPhase",3,IIF(Fields!GroupFieldName.value="ThirdPhase",4,5))))
Rajkumar Yelugu
May 15th, 2012 7:37am
Hello,
Check out the example in the link below. It may help you.
http://stackoverflow.com/questions/3938234/why-does-sql-server-2008-order-when-using-a-group-by-and-no-order-has-been-speci
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 7:45am
You could try renaming the data (i.e. "1 - First Phase", "2 - Second Phase" etc)
sql
case
when phase = 'First Phase' then '1 - First Phase'
when phase = 'Second Phase' then '2 - Second Phase'
...
...
end as Phase
May 15th, 2012 8:31am
I essentially want something looks like this;
The coloured dots are data retrieved from a database. I need the ordering of the red dots like shown (e.g. not alphabetical order, but the order I want them in)
The green dots are items from the database as well, i need these to list UNDER each phase? Not by the side...
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2012 8:40am
Add this onto your SQL Query, it will create a number against each phase;
'Phase Number' = CASE
WHEN [Phase] = 'First Phase' THEN '1'
WHEN [Phase] = 'Second Phase' THEN '2'
WHEN [Phase] = 'Third Phase' THEN '3'
WHEN [Phase] = 'Fourth Phase' THEN '4'
END
Then sort your tablix by 'Phase Number' - leave the group by as [Phase] to keep the wording.Rob Hardy
May 15th, 2012 10:24am


