Home » Developer & Programmer » Reports & Discoverer » Selective sorting on report group (Forms 6i)
Selective sorting on report group [message #485912] Sat, 11 December 2010 05:38 Go to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

I have a Group report based on one group.For eg..there is machine (Group) and it has detail records .The problem is there are certain specific machine on which i want sorting to be done the rest will be not sorted.


machine WX
Details not be sorted

machine sh4
Details to be sorted

machine sh5
Details to be sorted

machine AN1
Details not to be sorted
Re: Selective sorting on report group [message #485913 is a reply to message #485912] Sat, 11 December 2010 05:53 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
What exactly do you want it to sort on?
Re: Selective sorting on report group [message #485914 is a reply to message #485913] Sat, 11 December 2010 06:18 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

i want to do sorting on 2 specific machines comming from the same group.
Re: Selective sorting on report group [message #485915 is a reply to message #485914] Sat, 11 December 2010 07:54 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Put a case statement in your group that will return the column you want to sort on if the group is the one you're interested in or null otherwise. Set report to sort on the case statement.
Re: Selective sorting on report group [message #485917 is a reply to message #485915] Sat, 11 December 2010 08:01 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

can you give me some examples.
Re: Selective sorting on report group [message #485918 is a reply to message #485917] Sat, 11 December 2010 09:39 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thinking aloud: you have some groups. You want detail records to be sorted for certain groups (so I guess it is important for you to see them sorted), and you don't want to sort details for some other groups (so you don't actually care whether they are sorted or not).

If that's so, why would you distinguish "sorted" groups from "unsorted ones"? Simply sort them all!
Re: Selective sorting on report group [message #485948 is a reply to message #485918] Sat, 11 December 2010 23:15 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

i understand that littlefoot but its a requirement here , any possibilties of doing that using case statement .
Re: Selective sorting on report group [message #485961 is a reply to message #485948] Sun, 12 December 2010 04:19 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you actually tried what I said?
There's nothing difficult or special about it.
Re: Selective sorting on report group [message #485964 is a reply to message #485961] Sun, 12 December 2010 04:24 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

Dear Cookiemonster,

i tried using decode but the second column is not getting sorted.
"SELECT * FROM EMP
ORDER BY DECODE(:P_VAL,1,ENAME,DEPTNO,2,EMPNO);"
Re: Selective sorting on report group [message #485967 is a reply to message #485964] Sun, 12 December 2010 05:17 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Look up decode syntax, you've got some of the parameters the wrong way round.
Re: Selective sorting on report group [message #485973 is a reply to message #485967] Sun, 12 December 2010 06:10 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

can you please help me by giving one example please...
Re: Selective sorting on report group [message #485976 is a reply to message #485973] Sun, 12 December 2010 06:35 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
SELECT ...
FROM ...
WHERE ...
ORDER BY (CASE WHEN (group = <group you're interested in> THEN <column you want to sort by>
          ELSE NULL
          END)

[Updated on: Sun, 12 December 2010 07:24]

Report message to a moderator

Re: Selective sorting on report group [message #486387 is a reply to message #485976] Wed, 15 December 2010 05:15 Go to previous message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

Thanks cookiemonster you are brilliant it really works...
Previous Topic: Drill down report
Next Topic: Creating data link using a column only selected in one group
Goto Forum:
  


Current Time: Sat Apr 20 04:00:05 CDT 2024