Alternate Sort - Month
Hi All,
We set up the following Alternate sort custom folder:
Select to_date(MONTH_OF_YEAR,'MON'), ALTERNATE_SORT
FROM
select 'December' MONTH_OF_YEAR , 1 ALTERNATE_SORT from dual union
select 'January' MONTH_OF_YEAR , 2 ALTERNATE_SORT from dual union
select 'February' MONTH_OF_YEAR , 3 ALTERNATE_SORT from dual union
select 'March' MONTH_OF_YEAR , 4 ALTERNATE_SORT from dual union
select 'April' MONTH_OF_YEAR , 5 ALTERNATE_SORT from dual union
select 'May' MONTH_OF_YEAR , 6 ALTERNATE_SORT from dual union
select 'June' MONTH_OF_YEAR , 7 ALTERNATE_SORT from dual union
select 'July' MONTH_OF_YEAR , 8 ALTERNATE_SORT from dual union
select 'August' MONTH_OF_YEAR , 9 ALTERNATE_SORT from dual union
select 'September' MONTH_OF_YEAR , 10 ALTERNATE_SORT from dual union
select 'October' MONTH_OF_YEAR , 11 ALTERNATE_SORT from dual union
select 'November' MONTH_OF_YEAR , 12 ALTERNATE_SORT from dual
The problem is that when we join this to the Auto Month Item in the folder that its not sorting correctly.
Should we be using a different Mask for date conversion?
Thank You,
-Gus
Hi Gus
An alternate sort only works with a list of values when the alternate item is available within the original data set, you cannot use an alternate sort on a data column using an item in a different folder. The LOV will sort but not the data items themself.
To get around this, what you need to do is to create a new calculated item in your report, using a DECODE on the month, and create new values that can be sorted.
For example, here is a workflow that will create a new sort item for your first 3 months, December, January and February:
1. Create a new calulated item NEW_MONTH
2. Use this code inside the calculation:
DECODE(Month, 'December', '1. December', 'January', 2. January', 'February', 3. February', Month)
3. Place a sort on the NEW_MONTH item
By prefixing the month names with a number, we can now use a natural sort to place the months in their correct order.
Does this help?
Regards
Michael
Similar Messages
-
How to sort month names in Design studio
Hi Community,
Is there any way to sort month names in proper order (ie jan,feb,mar......) in design studio!!
Please help
Thanks
VivekAs Onur suggests, if you are using BEx Queries, it is certainly possible at least in/through BEx Queries, see this answer in another thread: Re: How to create loop in Design Studio
Regards,
David -
Problem of sorting month name in pivot table
Hello,
I have a month name that is sorted by month number in my repository.
When I select Year + month name + measure sorted by year then by month name and I look the result in a table, everything works perfectly but when I switch to a pivot table the sorting doesn't work : the pivot table sorts my month name in an alphabetical order instead of using the month number .... Is it normal ?
To find a solution, I have added my month number and I have sorted by year then by month number and I have hidden my column month number. This have solved my problem for the pivot table but if I attached a chart to it (by selecting "Chart Pivoted Results"), the label of the bottom axis contains the month number and the month name and I haven't found where I can hide this month number. Why the hidden option only works on the pivot table and not on the pivot chart ? And how I can do that ?
Thanks in advance for your help.No there is no Transient attribute involved , could you please tell me what might cause this error .
Basically this page is for inserting a record.
Thanks ,
Keerthi
Edited by: user1140193 on Oct 21, 2011 7:15 AM
Edited by: user1140193 on Oct 21, 2011 7:16 AM -
Hie Guys,
I have a dimension object - "Month" with values - 1, 2, 3, 4 as of now as the current month is April. I have created a variable for the "Month Name".
The formula is given below.
If (Month = 1) Then "Jan"
Elseif (Month = 2) Then "Feb"
Elseif (Month = 3) Then "Mar"
Elseif (Month = 4) Then "Apr"
Elseif (Month = 5) Then "May"
And so on ......
Now, my report has a cross-tab showing monthly employee hours. When using the "Month" object, I am able to sort it in ascending (1,2,3,4) or descending order (4,3,2,1). But, when I use the "Month Name" object, the months are not in order. I sorted the object with custom sort, but, since there is only data till the current month, I am only able to get - Jan, Feb, Mar & Apr in the report. In this case, when data is available for the next month, I will have to rearrange the sorting order again. Could anyone please tell me what I need to do in order for the "Month Name" column to automatically sort in order as new Month data becomes available (i.e. Jan, Feb, Mar, Apr, May, June, July, Aug, Sept, Oct, Nov, Dec)? Thanks.Hi jeewan Pandey
This trick will work
Trick 1
1) place the Month number in cross tab coulumn
2)Now Create condition rule in 4.x , alterter in 3.x
3)Click on formula and enter the formula you had wirtten or add the month name in that
4) Now you will see the month names intead of month number on cross tab column
Trick 2
1) Place the month number on cross tab
2) place the month name above the month number in cross tab column
3)Now right click on cross tab and hide the month number dimension
Hope this will help you
Let me know still the solution is not resolved -
Sorting month Chronologically ( column 1 )
I have a cross tab report showing "agent performance" by "month", the report is laid out like this
April-2010 Feb-2010 Jan-2010
Average handle time
Average talk time
Everything works as it should except the way the months are sorted. The months are being sorted alphabetacally instead of chronologically. In other words, I would like jan-2010 come first followed by Feb-2010 then march 2010 and so on.
I guess some formulas need to be used. Any help will be greatly appreciated.
Thanks
ParamHi Paramads, I assume you are not deaing with a true date.
so...
You can create a grouping formula,
If {Your Field) = "Jan" then 01 else
If {Your Field) = "Feb" then 02 else
If {Your Field) = "Mar" then 03 else
etc... thru
If {Your Field) = "Dec" then 12
This assume you are dealing with a month name instead of a number, if this does not help,
post what your data actually looks like. -
Alternate sort in interactive report
Hi,
I have several interactive reports where I need to enable sort on a column where the sort order is "custom" (I mean, not alphabetical nor numeric).
In other words, I want to display one column, but sort using another one when I select a sort icon (asc or desc) on displayed column header.
I'm pretty much sure there is no out-of-the-box solution to this, but any idea would be appreciated.
I created a trigger on WWV_FLOW_WORKSHEET_RPTS to replace any sort on my display column with my sort column. It worked but I had lots of side effects as sort icon not displayed at the end of the column header for example.
Thanks to share any idea you could have!Not the same as you imagine, but without any APEX-Tricks you could simply name your values a little different. THis could also be done in the query.
e.g.
select t.t_name, p.p_sort||'-'||p.p_display priority
from task t, priority p
where t.t_priority = p.p_sortI would always avoid doing stuff in the background, where the users might not understand directly, why it is the case.
So you could also help the users to understand the correct sorting by choosing appropriate report column names
select t.t_name, t.t_priority as priority, p.p_display priority_name
from task t, priority p
where t.t_priority = p.p_sortMost users will understand the difference when they sort by one or by the other column. And of cause the "better" sort order could be stored as default report settings. -
Sort By Month Name in Crosstab report
Hi,
I have one cross tab report in which in Datapoint I have one column which shows Month Details. When I run the reports the heading of Column comes as Month Name (ie Aug, April, Dec,.....) . Can you please help me to understand how can it be done it displayed in sorted month according to Month Name (ie. Jan, Feb, Mar, Apr.......). As per one of the Thread I tried to use to_date(Column_name) but it does not work as Column name is char column and cannot be converted to date.Hi ,
What if you use the following ...in bold?????
SQL> select ename,hiredate from emp;
ENAME HIREDATE
SMITH 18/12/1980
ALLEN 20/02/1981
WARD 22/02/1981
JONES 02/04/1981
MARTIN 28/09/1981
BLAKE 01/05/1981
CLARK 09/06/1981
SCOTT 18/04/1987
KING 17/11/1981
TURNER 08/09/1981
ADAMS 21/05/1987
JAMES 03/12/1981
FORD 03/12/1981
MILLER 23/01/1982
14 rows selected
SQL> select hiredate , to_number(to_char(hiredate,'MM')) from emp order by 2;
HIREDATE TO_NUMBER(TO_CHAR(HIREDATE,'MM
23/01/1982 1
20/02/1981 2
22/02/1981 2
02/04/1981 4
18/04/1987 4
21/05/1987 5
01/05/1981 5
09/06/1981 6
08/09/1981 9
28/09/1981 9
17/11/1981 11
18/12/1980 12
03/12/1981 12
03/12/1981 12
14 rows selectedOR ....
EVEN BETTER AS YOU NEED THE MONTH NAME....
SQL> ALTER SESSION SET NLS_DATE_LANGUAGE='AMERICAN';
Session altered
SQL> select hiredate , to_char(hiredate,'MON') , to_number(to_char(hiredate,'MM')) from emp order by 3;
HIREDATE TO_CHAR(HIREDATE,'MON') TO_NUMBER(TO_CHAR(HIREDATE,'MM
23/01/1982 JAN 1
20/02/1981 FEB 2
22/02/1981 FEB 2
02/04/1981 APR 4
18/04/1987 APR 4
21/05/1987 MAY 5
01/05/1981 MAY 5
09/06/1981 JUN 6
08/09/1981 SEP 9
28/09/1981 SEP 9
17/11/1981 NOV 11
18/12/1980 DEC 12
03/12/1981 DEC 12
03/12/1981 DEC 12
14 rows selectedRegards,
Simon
Message was edited by:
sgalaxy -
Applying Sorting for the Month Field
Hi,
When i apply sort to the month-name field for each quarter(Q1,Q2..), it sorts as 1)February 2)January 3)March..
Its sorts the month-name field in alphabetical order(F,J,M) not in the usual 1)January 2) February 3)March order..
To sort this issue i added the numeric field called month with values 1,2,3..
How to sort the month-name field as January, February???And if you're still struggling, [read this|http://blog.davidg.com.au/2011/03/sorting-months-in-webi.html].
-
Ordering by Month in the DAshboards
Hello to all.
I am creating dashboards in the OBIEE and dealing with dates. I would like to order the dates here by months, instead of alphabetically as by default. Please, any help from you?
Regards,Hi user8801078,
An alternate and simple process for Dates Sort Orders is to create calculated columns to influence the sort order of a Date Column (Including Month, Year, Qtr, Week etc...).
To create Calculated Date Sort Columns do the following
1. Make sure you set the Date Dimension in Business Model as Time Dimension and the hierarchy is Year, Quarter, Month, Day.
2. In the Date Logical Table, duplicate the columns Day, Month, Quarter etc.
3. Rename the new columns as Day Sorter, Quarter Sorter, Month Sorter
4. Define the new columns math as follows. Open Properties of the column and Check Use existing logical columns as the source then in the expression builder.
For Day Sorter:
CAST ( SUBSTRING("YOUR SUBJECT AREA"."Time"."Day" FROM 7 FOR 4) AS INTEGER ) * 10000 + CAST ( SUBSTRING("YOUR SUBJECT AREA"."Time"."Day" FROM 1 FOR 2) AS INTEGER ) * 100 + CAST ( SUBSTRING("YOUR SUBJECT AREA"."Time"."Day" FROM 4 FOR 2) AS INTEGER ) * 1
For Month Sorter:
CAST ( SUBSTRING("SUBJECT AREA"."Time"."Day" FROM 7 FOR 4) AS INTEGER ) * 10000 + CAST ( SUBSTRING("SUBJECT AREA"."Time"."Day" FROM 1 FOR 2) AS INTEGER ) * 100
For Quarter Sorter:
CAST ( SUBSTRING("SUBJECT AREA"."Time"."Quarter" FROM 11 FOR 4) AS INTEGER ) * 100 + CAST ( SUBSTRING("SUBJECT AREA"."Time"."Quarter" FROM 9 FOR 1) AS INTEGER ) * 1
5. Final step is to tell BI Server to take these new columns while sorting the Date Columns. To do this, open the properties of Day Column and click the Set... button. Select the Date Sorter Columns. Similarly set Month's sort order = Month Sorter and Quarter's sort order = Quarter Sorter.....
You dont need to include these sort order columns into Presentation Layer. Check the results with a sample report with Date, Month and Quarter.
Good Luck
Sai -
Sorting a Crosstab by "GL Period Number" but Showing "GL Period Name"
We are trying to create a report that has "GL Period Name" (JAN-09, FEB-09, MAR-09") across the top but the report sorts them by Alpha giving us:
FEB-09, JAN-09, MAR-09
We are even trying to use "GL Period Number" to get the Numeric order but to not want to display it.Hi Chris
You need to create an alternate sort for the Period Name using the Numeric order as the alternate.
You do this in the Admininstrator tool by creating a list of values for the Period Name, perhaps against a Custom SQL folder, and then assigning the LOV to the GL Period Name by editing the Property called Item Class.
In Custom SQL you can use something like this:
SELECT DISTINCT PERIOD_NAME
FROM
table_with_period
ORDER BY
numeric_value
You create an Item Class (aka list of values) on the PERIOD_NAME in this folder. When creating the item class make sure you uncheck the box which says Sort and remove duplicates. This is already being done by the Custom SQL.
With the Item Class built, go to the GL_PERIOD_NAME, right-click on it and select Properties.
Look for the Item Class property (its about half way down the list) then click in it. From the list of available Item Classes pick the one that was created against the Custom SQL folder.
Hint: a good idea would be to create a new business area called LOOKUPS and place all your custom lists of values in here. Only the administrator would have access to this area. However, any item class built against an object in here will be available for use in your real business areas. In order to make the assignment in Discoverer administrator you will need to have the LOOKUPS business area open as well as any business area you will be attaching the item class to.
Hope this helps
Best wishes
Michael -
Sorting on non-displayed items - can it be done ?
Hi,
I'm very new to Discoverer (and this forum), so apologies if I'm covering old ground.
I've created a simple discoverer table report and the folder I've based the data on has a number of columns that determine the sort order i.e. called 'activity_type_sort_order', 'activity_sort_order', 'enclosure_order_order' - this is because the related columns activity_type, activity and enclosure are VARCHAR but contain numeric values.
Hence, the existing application displays the data in the correct order in the Forms and Reports without showing the user the underlying columns that are determining the order.
I want to do something similar in Discover i.e. produce a report that displays the columns activity_type, activity, enclosure but sorts the data based on 'hidden' columns activity_type_sort_order, activity_sort_order and enclosure_sort_order.
I tried creating my first Discoverer report and it seems to need the activity_type_sort_order, activity_sort_order and enclosure_sort_order as displayed items in the workbook in order to all the rest of the data to be sorted.
Is there any way I can sort using these fields but not actually display them ?
I've read that I can create an alternate sort in the EUL but I've got 1000's of values.
Can anybody help ?
Many thanks
mknipeHi,
You should be able to use the hidden sort option. In the sort tab add the sort columns and then change the sort type to be hidden.
Rod West -
Parameters to be sorted in alphabetical order
Hi,
Can you please let me know whether the parameters values are by default sorted in alphabetical order...refering to discoverer viewer/plus...
Thanks in advance
SriIf you are referring to the item classes (list of values), they would be sorted in alphabetical order. The parameter values wud appear in the same order in which the lovs appear in admin.
If you want to customize the sorting (reorder), you can do so using alternate sort tab in edit item class.
you can refer to the admin users guide. -
Sorting contnents of a txt file
Hi, I have a txt file with data as follows....
Lee=50
mark=90
bob=100
billy=75i need to read this file in and then print something like.....
bob scored 100
mark scored 90
billy scored 75
lee scored 50notice they are in numerical order. Does anyone know how to go about this?I happen to have a sorting example thats almost exactly what you need:
** Use the Collections API to sort a List for you.
** When your class has a "natural" sort order you can implement
** the Comparable interface.
** You can use an alternate sort order when you implement
** a Comparator for your class.
import java.util.*;
public class Person implements Comparable
String name;
int age;
public Person(String name, int age)
this.name = name;
this.age = age;
public String getName()
return name;
public int getAge()
return age;
public String toString()
return name + " : " + age;
** Implement the natural order for this class
public int compareTo(Object o)
return getName().compareTo(((Person)o).getName());
static class AgeComparator implements Comparator
public int compare(Object o1, Object o2)
Person p1 = (Person)o1;
Person p2 = (Person)o2;
return p1.getAge() - p2.getAge();
public static void main(String[] args)
List people = new ArrayList();
people.add( new Person("Homer", 38) );
people.add( new Person("Marge", 35) );
people.add( new Person("Bart", 15) );
people.add( new Person("Lisa", 13) );
// Sort by natural order
Collections.sort(people);
System.out.println("Sort by Natural order");
System.out.println("\t" + people);
// Sort by reverse natural order
Collections.sort(people, Collections.reverseOrder());
System.out.println("Sort by reverse natural order");
System.out.println("\t" + people);
// Use a Comparator to sort by age
Collections.sort(people, new AgeComparator());
System.out.println("Sort using Age Comparator");
System.out.println("\t" + people);
} -
How to show montha name starting from APR to MAR
Hi,
How to show financial year in report .
I.e
When i select month column in my report i need to get values starting from APR to till MAR. Can any one tell me how to show it.
APR,
MAY,
JUN,
JUL,
AUG,
SEP,
OCT,
NOV,
DEC,
JAN,
FEB,
MARHi,
Steps to achieve,
1. Go to analysis pull it out your month columns two times (let rename it month Id and month name)
2.) edit formula on month Id columns put it below contional statement
E.x:
Case when month name = 'January' then '1'
When month name ='February' then '2'
When case month name='November' then '11' Else '12' end
3.) Go to month name columns in your analysis criteria and edit formula here u just make it first 3 char of your month name columns by using left( month name, 3)
4 ) sort month name columns by using month id columns then hide month id columns it will work as you expected
Another solution:
First you need to add the function monthname in the column formula. This will give you month names.
Ex-MONTHNAME("Cal Date")
To sort, add bin or write case statements in other column and sort it.
Ex- case
when MONTHNAME("Cal Date")='Jan' then 1
when MONTHNAME("Cal Date")='Feb' then 2
end
Hope this help's
Thanks,
Satya -
Printing an Event list for a calendar
Hi I track events in a set calendar within ical, these can be weeks apart. is there anyway of printing a list of events in a calendar say for that year ?
My solution: I created a macro in excel
This is what I did
- copied and pasted search results from ical to excel
- (Next I deleted the first column and instead gave my calendar a header name)
- under "data" chose "text to columns"
- created columns using a space as a delimiter
- highlighted the date column (not months or year, just date) and under format chose cells (HERE IS THE KEY STEP): and changed the category to text
- I then did a search and replace for commas in the date field and replaced the commas with nothingness
- I was then able to, using sort, put everything in chronological order (first sort: sorted month and date colums, making sure to chose under "options" for the month field the month names. Then I did a separate sort for the year column)
And that's it!
I saved it as a macro and now I can create calendars for any other search results that I want
Maybe you are looking for
-
Firefox will not start. When I try to open it it gets stuck trying to restore the previous session. It shows "connecting" and the little round working cursor just spins. The program says (not responding) in the top. Please help me fix this, thanks
-
Mpd and pulse problem - Connection refused [SOLVED]
I'm having problems getting mpd to play nice with pulse-audio. Pulse is installed and works with vlc, mplayer, flash, etc. just fine. When I try to play through mpd the song in the gui simply shows a status of "paused" and the following gets writte
-
Need to Pick From Jan to dec Period
Hi All, I am working in GL(Argentina Localization) I wanted to change a standard program functionality,It is running or APR TO MAR period(Set of Book Calender), I wanted to make it to run at Jan to dec...Any clue? Regards Raghavendra Nara
-
How to code in SE54 transaction in Event 01
Hello All, I have a requirement to create a functionality of maintainance view (like SM30), but there are validations for Event 01. I know that this will create a new include program, but i have no idea on how to code the validations, for example if
-
Grow thumbnail to main image and then back
I am wanting to modify the dynamic photo Gallery to Grow each thumbnail to the main image position. When another thumbnail is selected it should shrink back to it's original position before the Grow. When another thumbnail is clicked it does the sam