Convert date to week of the year in Query designer
Hi,
I have a requirement to convert date ( a characteristic in the query) to week of the year. For eg. if the date is 01/11/2008 then the week to be displayed is 2008/44.
Please not that the week is not populated in the Infocube of the same. So i need to convert it in the query designer only.
Please suggest if you have ideas.
Regards
Sapna
Hi,
I am trying to get the data by using a virtual characteristic. The problem is i am not able to debug METHOD : IF_EX_RSR_OLAP_BADI~COMPUTE. Can u please help me to reach the breakpoint within this.
Done....
Sapna
Edited by: Sapna Jaiswal on Dec 2, 2008 11:21 AM
Similar Messages
-
Converting "01Jan2008" to week in the year
Is there a function in Microsoft Excel to convert a date to a week in the year ? I know this is an Oracle site but I figure there is overlap.
Is there a function in Microsoft Excel to convert a
date to a week in the year ? I know this is an Oracle
site but I figure there is overlap.You figure there's an overlap between a relational database and a spreadsheet? If you had said there was an overlap between Oracle and Access I could see where you're coming from but not Oracle and Excel.
Anyway here's the help from MS Excel...
WEEKNUM
Returns a number that indicates where the week falls numerically within a year.
If this function is not available, and returns the #NAME? error, install and load the Analysis ToolPak add-in.
How?
On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click OK.
If necessary, follow the instructions in the setup program.
Syntax
WEEKNUM(serial_num,return_type)
Serial_num is a date within the week. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text.
Return_type is a number that determines on which day the week begins. The default is 1.
Serial_num Week Begins
1 Week begins on Sunday. Weekdays are numbered 1 through 7.
2 Week begins on Monday. Weekdays are numbered 1 through 7. -
How to display the week of the year in a report
Hi,
I am doing a report, that needs to break down the information, according to month and then week.
The week of the year isn't stored anywhere in the database, so i guess it would have to be calculated.
How would i go about doing this in report?hi, yes thats what i mean.
So if i run my report for 01-feb-2008 to 30-march-2008
it needs to group the data according to weeks.
eg. week5 (data)
week6 (data)
etc....
i got this code: select to_char(sysdate, 'IW') from dual;
will it allow me to do this? -
Function Module to convert date to week from Sunday to Saturday
Hi,
In BW the convertion date to week always give week from Monday(1) to Sunday(7)
I'm looking for a function module to convert date to week from Sunday(1) to Saturday(7)
Thanks
SebastienHi,
I think this SAP standardized. Maybe you need to create custom FM.
You can copy SAP FM DATE_GET_WEEK. in the FORM FIRSTWEEK, I see below case,
CASE start_weekday.
WHEN if_calendar_definition=>c_monday.
start_weekday_number = 1.
WHEN if_calendar_definition=>c_tuesday.
start_weekday_number = 2.
WHEN if_calendar_definition=>c_wednesday.
start_weekday_number = 3.
WHEN if_calendar_definition=>c_thursday.
start_weekday_number = 4.
WHEN if_calendar_definition=>c_friday.
start_weekday_number = 5.
WHEN if_calendar_definition=>c_saturday.
start_weekday_number = 6.
WHEN if_calendar_definition=>c_sunday.
start_weekday_number = 7.
ENDCASE.
Maybe you can play something here. -
Hi,
I need a query for week of the year. i.e. if we pass the date as parameter which week the date belong.
for ex. 31-AUG-2008 then 35th week, 01-SEP-2008 then 36th week.
please help to solvelYes, many ways! :-)
In general built-in functionality such as the IW format on date conversion is the efficient way to do things - why reinvent the wheel? But, if your week numbers are not the standard ones (and lots of organisations run their own calendars) perhaps you could use a join to a look-up table that maps dates to week numbers. -
Week of the year number appears out of sync with the day of week the week #
Using the querry below on on a table where the pdate value is a sequential list of dates on an Oracle 11 database the results show the week of the year number changes on the day of the week number 7 not the day of the week number 1. Is there a patch to fix this?
select
pdate,
to_char(pdate,'D') dow,
to_char(pdate,'Day') Day_name,
to_char(pdate,'WW') week_of_the_Year
from daily_period_tab
where pdate >= '07-jan-11'
and pdate <= '09-jan-11'
07-JAN-11 6 Friday 01
08-JAN-11 7 Saturday 02
09-JAN-11 1 Sunday 02Hi,
Independent of you NLS settings, you can do this:
SELECT TRUNC ( dt + 1
, 'IW'
) - 1 AS sunday
FROM table_x;The output in the sunday column will be the Sunday on or before dt. The "magic number" 1 indicates that your week starts 1 day before the ISO week, which starts on Monday.
Or if you want to use your NLS settings:
ALTER SESSION SET NLS_TERRITORY= 'AMERICA';
SELECT TRUNC ( dt
, 'DY'
) AS sunday
FROM table_x;
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using. -
Problem in getting exact week of the year (Reposted)
Hi,
Can somebody respond to my posting please. I am posting it second time since nobody replied me till yet.
I make use of below code to get exact week of the year.
// Assumes the provided date is in 'ddMMM' format
SimpleDateFormat sdf = new SimpleDateFormat ( "ddMMM" );
Date parsedDate = sdf.parse( dateString );
Calendar calendar = Calendar.getInstance();
calendar.setTime( parsedDate );
int week = calendar.get( Calendar.WEEK_OF_YEAR );
Problem which I am facing is that when I pass "dateString" as
"22Mar" then it gives week as 13 instead of 12 for year 2007.
I find out that making use of cal.setFirstDayOfWeek( Calendar.MONDAY ); and cal.setMinimalDaysInFirstWeek( 4 ); statement eradicates the problem, ideally values should be
cal.setFirstDayOfWeek( Calendar.SUNDAY); and cal.setMinimalDaysInFirstWeek( 7); because for US first day of the week should be SUNDAY and minimum number of days should be 7 when I start from Sunday.
Please help me to understand the resolution. Is it correct or not?
Is it possible to solve the problem without specifying cal.setFirstDayOfWeek( Calendar.MONDAY ); and cal.setMinimalDaysInFirstWeek( 4 ).
This seems to be hardcoded for each year.What am I missing? If you can't accept the ISO rules then you are going to define and implement your own algorithm. UsingSimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
Date parsedDate = sdf.parse( "2007/01/01" );
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime( parsedDate );
for (int count = 0; count < 366; count++)
int week = calendar.get( Calendar.WEEK_OF_YEAR );
System.out.println(week + "\t" + sdf.format(calendar.getTime()));
calendar.add(Calendar.DAY_OF_YEAR, 1);
}I get the week as 12 not 13 but I specified THIS year. If you don't specify a year then, quite rightly, it takes 1970. -
Problem in getting exact week of the year
Hi,
I have make of use of below code to get exact week of the year.
Now problem which I am facing is that when I pass "dateString" as
"22Mar" then it gives week as 13 instead of 12 for year 2007.
// Assumes the provided date is in 'ddMMM' format
SimpleDateFormat sdf = new SimpleDateFormat ( "ddMMM" );
Date parsedDate = sdf.parse( dateString );
Calendar calendar = Calendar.getInstance();
calendar.setTime( parsedDate );
int week = calendar.get( Calendar.WEEK_OF_YEAR );
I find out that making use of cal.setFirstDayOfWeek( Calendar.MONDAY ); and cal.setMinimalDaysInFirstWeek( 4 ); statement eradicates the problem, ideally values should be
cal.setFirstDayOfWeek( Calendar.SUNDAY); and cal.setMinimalDaysInFirstWeek( 7); because for US first day of the week should be SUNDAY and minimum number of days should be 7 when I start from Sunday.
Please help me out to understand the resolution. Is it correct or not?
Is it possible to solve the problem without specifying cal.setFirstDayOfWeek( Calendar.MONDAY ); and cal.setMinimalDaysInFirstWeek( 4 ). This seems to be hardcoded for each year.
Thanks in advance...What am I missing? If you can't accept the ISO rules then you are going to define and implement your own algorithm. UsingSimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
Date parsedDate = sdf.parse( "2007/01/01" );
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime( parsedDate );
for (int count = 0; count < 366; count++)
int week = calendar.get( Calendar.WEEK_OF_YEAR );
System.out.println(week + "\t" + sdf.format(calendar.getTime()));
calendar.add(Calendar.DAY_OF_YEAR, 1);
}I get the week as 12 not 13 but I specified THIS year. If you don't specify a year then, quite rightly, it takes 1970. -
Get Current year in Query Designer
Dear all
I don't know how to determine current year in Query Designer.
I have a report, i want to see some indexs in bance sheet and income statement in current year and previous year. but, I can only assign with the fixed year (ex, 2010), this is not flexible. I want to get current year on system and calculate previous year.
Please help me solve this problem
ThanksHi,
You can use the SAP Exit variable 0CALYEAR for current year. For Previous year you can offset this by -1.
You can refer this link for more Information,
http://help.sap.com/saphelp_bw33/helpdata/en/3f/89533e5ff4d064e10000000a114084/content.htm
Regards,
Hari.
Edited by: Hari Krishnan K on Jul 20, 2010 10:36 AM -
Currency conversion in the Business Explorer(Query design)
Hi Experts,
How to convert currencies from CAD to USD using the Current exchange rate 0011 for a particular record in the Business Explorer (Query Design).
Any useful answer will be rewarded with suitable points.
Thanks!
RohanCreate a currency coversion type for the exchange rate
Go to RRC1, enter a name for your new currency conversion type
on the exchange rate tab mark the radio button Exchange Rate Type.
enter the exchange rate type there
enter the target curr in the tar curr tab as USD
similarly in the query also enter the curr conversion key.
hope it helps,
assign points if useful -
Problem with the icon "Display query on the web" in Query Designer
Hi Friends,
I was told by my PM to give them all FI Modules standard business contenet reports, so for that reason i have installed all FI business content & loaded the data in the Dev Server, now i just want to show the reports, but i want excute these reports in Internet Explorer using the Icon "Display Query on the WEB" in query designer, when i click on that it isn't getting displayed in the browser.
the URL coming like this, "http://itcchqbd:8100/sap/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&INFOCUBE=0FIAA_C11&QUERY=0FIAA_C11_Q0001&VARIABLE_SCREEN=X&DUMMY=1"
getting the message in the page, the page can't be displayed,
How to solve this problem & how do i have to show the standard business content reports to all FI Superiors ?
awaiting for ur answers
Regards,
BalajiBalaji,
first check if you have enabled web reporting on your BW server ( there is a how to paper for the same )
another way to check out the same is to find out if there are existing web templates being published which would make the server web ready.
As for FI content - activate the FI relevant areas in Business content and then activate the respective datasources and then load the data.. or go trough the best practices for BW-FI ( service.sap.com/bestpractices) wnd then activate the best practices for the same.
Hope it helps.
Arun
Assign points if useful -
Maximum number of records displayed on the browser using Query Designer.
When you display a query on the web using Query Designer is there a maximum limit of how many records (rows) it can display? For example, can it handle 25 million records?
Thanks.Hi Sebastian,
I still find such a requirement weird as one cannot definitely go thru' so much of data at a time - it would thus always make sense to perhaps filter on some criteria which would make analysis & perhaps even download much faster. The limit as I understand is approx 750,000 data cells. Maybe the below link & SAP notes can help validate
Limitation in No. Of data cells displayed in BEx Analyzer
SAP Notes :-
Note 1040454 - Front-end memory requirement of the BEx Analyzer
Note 1030279 - Reports with very large result sets/BI Java
Note 1411545 - BExAnalyzer: safety belt for large resultsets
--Priya -
To find the version of query designer currently installed in BI DEV
Hi.. Where can I find the version of query designer (BI addon) installed in my BI DEVsystem.
Hi,
At the time of opening query designer it will show .
Open query designer and on menu bar go to help tab and select about .
Thanks. -
How to assign current date/time to a formula variable in Query Designer
How do I assign the current date to a formula variable in Query Designer? I need to use current data in a calculation and just need the date the report was run.
ThanksHi Philip,
There is an SAP formula variable to supply the current date in a formula. I think it is 0F_ADAY...install it from business content if you cannot see it in the query designer (formula box, under formula variables) and try using it.
Hope this helps... -
Fiscal Year Period - Query Designer - Characteristics Value
Hi Experts,
In query designer, characteristics value for 0FISCPER by default shows value of fiscal year variant V9. But for Fiscal year variant V9, 002.2014 is November 2013.
Now user want to display the correct period and its description (002.2014 is February 2014) which implies need to use different variant. Please let me how this can be changed.
Regards
Suresh KumarHi Suresh,
Try this
Path: Financial Accounting >> Financial Accounting Global settings >> Fiscal Year >> maintain Fiscal year variant (maintain shortened fiscal year)
Transaction Code: OB29
Regards,
Amit
Maybe you are looking for
-
Recently, my Audigy 2 started locking up and sqealing like a pig, so I thought I'd try to get new drivers from Creative's webpage. I am kind of confused when looking at the "drivers" available to me (Audigy 2, Windows XP). I have these choices.... .
-
I want to buy After Effects 7.0 (Mac) + an upgrade version, which is unfortunately an AE 5.5 Upgrade (Win) version. Can I change the upgrade version to platform AE 5.5. Mac? Thanks in advance! TobiWebbbb
-
My screen has gone blank and won't display any info. Can this be fixed?
I can still play music, but with no info on the screen I can't do much of anything else. Is this common and can it be fixed?
-
Is Ibook author available in the UK?
I've tried to find Ibook author in the Apps Store here in the UK - no joy!
-
SU-1b digital pen - send error - An unexpected err...
When i connect my pen or click send I get the following messgae: An unexpected error occurred (ox8000ffff)... in the log the files show with a server error against them. Help please, I,ve spent all day trying to set this up Thanks