Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column Grouping - Sorting Properties on Matrix 1

Status
Not open for further replies.
Oct 2, 2007
41
US
Hi,

My problem deals with a matrix report and its column group.
My specific question is: Is there a way to specify the sort order for scan-code - either in an expression or otherwise?

Row Groups : Employee, Date, Total-Hours-Worked
Column Group : Scan-Type (sorted By Scan Code 1,2,3, or 4)

Scan-Codes and corresponding Scan-Types are as follows:
1=Start
2=End
3=OnBreak
4=OffBreak

Currently the output is similar to this:
Employee Date Hours-Worked Start End OnBreak OffBreak
John Smith 01/04/2008 5 11AM 4PM 12PM 12:30PM

The desired output would be like this:
Employee Date Hours-Worked Start OnBreak OffBreak End
John Smith 01/04/2008 5 11AM 12PM 12:30PM 4PM


So the desired sort order would be 1, 3, 4, and 2

Thanks for any assistance.




 
You could create a new field in yoiur data set (SQL) or create a report variable that utilises a nested iif

=iif(Fields!Scan-Code.Value = 4, 1.5 , Fields!Scan-Code.Value)

This will substitute 1.5 for 4 (other fields appear to be in the correct order). When you sort on this new variable, your fields should be in the correct order

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
You put me on the right track. I simply placed this code in my query.

Thank you very much.

Code:
case  when intScanTypeCode=1 then 1 
	when intScanTypeCode=3 then 1.3 
	when intScanTypeCode=4 then 1.4
	when intScanTypeCode=2 then 2
End AS ScanCodeSort
 
No probs - that's something I've started to do a lot with RS - if there's any custom sorts, do it in the query itself. Sometimes I have as many "helper" fields in the query as I do actual data fields !

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top