How to get aggregation at Year-Month level??
Hi experts,
I've Date and Qty column in rpd. I've created the aggregated column in rpd with Sum aggregation (Sum Qty)
My report is coming in this format..
Date...........Sum(qty)
1/1/2009..........5
1/2/2009..........4
1/6/2009..........10
2/3/2009.........2
2/4/2009..........6
But I need the report like this....
Year-Mon.........Sum(qty)
2009-01-----------19
2009-02-----------8
Please help
hi bob,
1) Create a logical column yyyy/mm format using date col
CAST ( EXTRACT( YEAR FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 4 )) || '/' || CASE WHEN EXTRACT( MONTH FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") BETWEEN 10 AND 12 THEN CAST ( EXTRACT( MONTH FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 2 )) ELSE '0' || CAST ( EXTRACT( MONTH FROM "Sample".""."Samplesales"."Dim-Date"."Start Date") AS CHARACTER ( 1 )) END
2) Set the aggregate/content level to this column (yyyy/mm) format to the fact table
thanks,
saichand.v
Similar Messages
-
How to get the current year??
Hi all,
How to get the current Year??Hi,
Current Year & month are available in table MARV.
I hope this helps,
Regards
Raju Chitale -
I am an MBA student , doing a research project on e-learning authoring tools, would like to find out no. of licences sold/active to date for adobe captivate. how many get sold every year. any pointers/help is appreciated. cheers.
I doubt you'll get an answer in a user forum, sorry. This forum is meant for users to help other users when they have problems that have to be solved. You should contact Adobe itself.
-
How to get current fiscal year/quarter/month/week
Post Author: [email protected]
CA Forum: Semantic Layer and Data Connectivity
Hi friends,
I have to calculate
1. current year/quarter/month/week.
2.Previous year/quarter/month/week.
please tell the process to achieve the above scenerio's.
the structure of the fiscal_cal is as follows.
Name Null? Type
TODAY NOT NULL DATE
FISCAL_DAY NUMBER(8)
FISCAL_WEEK NUMBER(6)
FISCAL_MONTH NUMBER(6)
FISCAL_QTR CHAR(18)
FISCAL_YEAR NUMBER(4)
FISCAL_MONTH_WORK_DAYS NUMBER(2)
sample week data is as follows
FISCAL_WEEK
200752
200753
209901
Thanks.based on ur target database DBMS you can find a built-in functions be used in the universe designer to get the requirment you talked about, like in oracle
to_char(mydate,'yyyy') it will return the year in the yyyy format.
and the same way for the other things you want
to_char(mydate,'q') return the quarter.
w return the week of the month
ww return the week of the year
mm return the month
,, to get the last year
you can use also a builtin functions
like add_months(mydate,-12) that return the same date for the last year, and you can do the same operations as before.
its all related to the DBMS.
good luck -
How to add a date(Year, Month, Day) table in OBIEE Administrator
Hi,
I am new to this tool, we are developing a HR report for emp on leave or absentees. we have data since 1982 in our tables. we want to have a date table and dimension where we can give have a hierarchy for year, month, day, so that we can design our dashboards based on time. how we can do that in OBIEE Administrator and can we do it in warehouse builder as well, if so, how. ( we have a column for date in the table by name 'leave start date' and 'leave end date', can we use this and create our own table with year month and day as separate columns).
Thanks.hi,
Using date column u can create time dim in BMM layer
Create a new logical table and pull your date column to this table
Next,create following columns
Refer http://www.rittmanmead.com/2007/04/30/obi-ee-time-dimensions-and-time-series-calculations
leave start date
Year level :Extract(year from date_column)
Month and year level:CAST (Extract(month from fact_date_column) As CHAR(5) ) || CAST (Extract(yearfrom fact_date_column) As CHAR(5) )
Mon-YYYY: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), "Development".""."sample sales"."Dim - leave Date"."REPORT_DATE", 'MON-YY')
YYYY-MM : CAST ( EXTRACT( YEAR FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 4 )) || '/' || CASE WHEN EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") BETWEEN 10 AND 12 THEN CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 2 )) ELSE '0' || CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 1 )) END
Year Quater :: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'YYYY') || '0' || EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'Q')
Day: EXTRACT(DAY FROM DATE_COLUMN)
Thanks,
Saichand.v -
How to get count for missing month
I created a view as follows:
CREATE OR REPLACE FORCE VIEW "Vinfection1" ("MONTH", "COUNT") AS
select "MONTH","COUNT" from (
select to_char(s.pdate,'Mon-yyyy') as month, count(*) as count
from surproc s, diagnosis_surproc d
where s.surprocid = d.surprocid and d.diagnosisid in ('506', '507', '508', '509', '510')
group by to_char(pdate,'Mon-yyyy'))
order by to_date(month,'Mon-yyyy')
Some months are missing in the view. I want to put that month and 0 in the view. How to do it?
Thanks,
JenniferHi, Jennifer,
You need to outer-join to some table or result set (such as all_months, below) that has one roe per month.
Here's one way:
CREATE OR REPLACE FORCE VIEW Vinfection1 (month, month_s, cnt) AS
WITH all_months AS
SELECT ADD_MONTHS (first_month, LEVEL - 1) AS month
FROM (
SELECT TRUNC (MIN (pdate), 'MONTH') AS first_month
, TRUNC (MAX (pdate), 'MONTH') AS last_month
FROM surproc
CONNECT BY LEVEL <= 1 + MONTHS_NETWEEN (last_month, first_month)
SELECT a.month
, TO_CHAR (a.month, 'Mon-yyyy') AS month_s
, COUNT (*) AS cnt
FROM all_months a
LEFT OUTER JOIN ( surproc s
JOIN diagnosis_surproc d ON s.surprocid = d.surprocid
AND d.diagnosisid IN ('506', '507', '508', '509', '510')
) ON a.month = TRUNC (s.pdate)
GROUP BY a.month
/Avoid table- and column names that are non-standatrd (such as names that need double-quotes), or are built-in function names (such as COUNT).
Don't use ORDER BY in a view. Almost anything you do with the view will cause the ordering to be lost anyway.
Even if you do have an ORDER BY clause in the view, you'll often want to ORDER BY month. Rather than call TO_DATE whenever you need to sort, I suggest having two month columns; month (whcih is a DATE) for sorting, filtering and joining, and month_s (whcih is a VARCHAR2) for displaying.
Use ANSI join syntax, especiallly for outer joins.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, 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.
Edited by: Frank Kulash on Mar 20, 2012 12:03 PM
Added outer join condition -
How to get last date of month ?
Dear all
hi!!!
How can I get the last date of a particular month?
I mean if the month is Feb, last date of the month should be 28.
Is it required to write in loop or there is any method to get it.
Please write me urgently,
thanx,
SamirHello ,
You can get the last date of a particular month of a particular year like this :
int year= 2000;
int month=1; // February (month is zero based )
int date = 20;
java.util.GregorianCalendar gc = new java.util.GregorianCalendar(year,month,date);
int last_day = gc.getActualMaximum(Calendar.DAY_OF_MONTH));
Sandip -
How to get current fiscal year.
Hi Experts,
I am working on Asset Management.I need to get current fiscal year.
I have to enter fiscal year on selections screen which i have to validate that it should not be greater than current fiscal year.
For above i have used following code snippet but i have hard coded variant as 'MK'.
To get variant i was using function '/IBS/RB_FI_GET_FISCAL_YEAR_VAR' but in my selection screen we have to enter multiple company codes. if i will keep this function inside loop then it may give multiple variants.
How to resolve this ?
DATA : l_year(4) type c,
l_date TYPE sy-datum.
CALL FUNCTION '/IBS/RB_FI_GET_FISCAL_YEAR_VAR'
EXPORTING
i_company_code =
IMPORTING
E_FISCAL_YEAR_VARIANT =
EXCEPTIONS
COMPANY_CODE_NOT_FOUND = 1
OTHERS = 2.
l_date = sy-datum - 700.
l_date = l_date + 1.
IF sy-subrc EQ 0.
CALL FUNCTION 'GM_GET_FISCAL_YEAR'
EXPORTING
I_DATE = l_date
i_fyv = 'MK'
IMPORTING
E_FY = l_year
EXCEPTIONS
FISCAL_YEAR_DOES_NOT_EXIST = 1
NOT_DEFINED_FOR_DATE = 2
OTHERS = 3.
IF sy-subrc EQ 0.
IF s_gjahr-low GT l_year.
PRINT Error Message "Entered fiscal year should not be greater than current fiscal year".
ENDIF.
ENDIF.make it simpler by using - DATE_TO_PERIOD_CONVERT
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
I_DATE = SY-DATUM
I_PERIV = L_VARI "Fiscal year Variant - refer to tab T009B
IMPORTING
E_BUPER = L_BUPER " Fiscal Period
E_GJAHR = L_GJAHR " Fiscal year
EXCEPTIONS
INPUT_FALSE = 1
T009_NOTFOUND = 2
T009B_NOTFOUND = 3
OTHERS = 4
Hope this will solve ur problem. -
How to get name of the month from current date.
Hi,
How to get the name of the month from current date.
Thanks,
SenthilSethil,
Use your date(let us say Date1) instead of sy-datum.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
MONTH_NAMES = itab_month
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE itab_month
WITH KEY MNR = date1+4(2).
itab_month-LTX will contain the value you are looking for
Good luck
Raghava -
How dynamically get an agent f a level-by-level workflow after PO changed
Hi all:
I'm trying to create a level-by-level workflow after PO changed, but how dynamically get an agent and how assign it to
task dynamically?
Thank you very much!!!Hi Sony,
There are diffrent ways to get agent level by level....it depends from where you are getting the agents.
1>Suppose you have 2 level PO worklfow and my agents are stored in some custom table:-
level1 -- agent1
level2 --agent2
2> You can create two attributes in your BO i;e zgent1& zagent2.
3> Inside the attributes zagent1 u will get the actual agents from custom table by putting code
i.e select agent1 into zagent1 from zcus_tab where level = 1.
4> Inside the attributes zagent1 u will get the actual agents from custom table by putting code
i.e select agent1 into zagent1 from zcus_tab where level = 2.
5> Now generate the BO...and test it ..u will se the user id of agents in the attributes populated.
6> Now bind these both attributes to workflow container.
7> Use attribute ZAGENT1 for level 1 approval task in worlfow.
8> Use attribute ZAGENT2 for level 2 approval task in worlfow.
The values will comes dynamically from custom table...which u will maintain. -
How to get the Organizational Unit One level up
Hi
Does any one know any function module to get the org unit one level up by giving the current Organizational unit as input. Please reply very urgent.Hello Nirmal
I am usually using the following function module to read to OM:
* SAP_SORG
* OrgStructure with assigned orgunits)
REFRESH: lt_struc.
CALL FUNCTION 'RHPH_STRUCTURE_READ'
EXPORTING
plvar = '01' " active Planvar.
otype = 'O' " OrgUnit
objid = l_wa_cb1-objid " Toplevel-Node
wegid = 'SAP_SORG'
begda = iw_begda
endda = iw_endda
pup_info = 'X'
with_stext = 'X'
tdepth = 0 " alle Sub-Levels
TABLES
stru_tab = lt_struc
EXCEPTIONS
catalogue_problem = 1
root_not_found = 2
wegid_not_found = 3.
The parameter <b>WEGID</b> is the crucial on which determines the objects that are read from the OM. In your case you will need <b>WEGID = 'A002'</b> (reports (line) to).
To understand the <i>evaluation path</i> (WEGID) better have a look at transaction <b>PPST</b>.
Regards
Uwe -
Getting aggregated values on disaggregated level...
Hi all,
For example I have the following selection in my query:
Query 1.
City Store Item Sales @ UOM
City1 Store 1 Item1 100
Item2 150
Store 2 Item1 200
Item2 125
Item sales quantity on the City level will be the following:
Query 2.
City Item Sales @ UOM
City1 Item1 300
Item2 275
And I need to use this data in the first query, so I could access the aggregated city sales data in each disaggregated row, like this:
Query 3.
City Store Item Sales @ UOM Sales @ UOM (City lvl)
City1 Store 1 Item1 100 300
Item2 150 275
Store 2 Item1 200 300
Item2 125 275
Does anyone have an idea how this could be achieved?
I've already tried restricted and calculated key figures, and it seems that this isn't an option in this case...
Thanks.
Best regards,
AndreyHi Andrey,
I have tried the same at my end. And yes you are right. It is coming as you have showed here.
But i have tried the same requirement around a year back and I had achieved it, unfortunately I am not able to completely recall the same.
However there is one way which you can achieve a similar display.
You could view the report to this level
City Item Store Sales @ UOM Sales @ UOM (City lvl)
City1 Item 1 Store1 100 300
Store2 200 300
Item 2 Store1 150 275
Store2 125 275
You can achieve the above display by doing the below
for the second key figure (city level) - use formula (sumct (base KF) )
With this we will get the above view, but one disadvantage is we have to let the result rows for "store" be displayed. If it is removed the second KF will change.
But I am still trying at my end and will let you know as soon as I figure it out.
Regards,
Joe -
How to get all permissions on server level and project collection level via tfs java sdk?
i need to list project-collection level's permission and project level's permission on my project. now i have connected to tfs and i have got project collection list and user list via tfs java sdk. but i can't find the way to get the permission name list
and permission list. how can i do to get that?
i have checked the database, and find that the actions have some discrepancies with the tbl_securityaction'data.
Can anyone give me some advice on that?
davyDavid, Thanks for your reply.
I have test the code above, but still get error. here is my code:
final TFSTeamProjectCollection tpc = SnippetSettings.connectToTFS();
final DefaultClientFactory factory = new DefaultClientFactory();
final IIdentityManagementService2 ims = (IIdentityManagementService2)factory.newClient(IIdentityManagementService2.class, tpc);
final String scopeId = null;
final String[] propertyNameFilters = null;
TeamFoundationIdentity[] appGroups = ims.listApplicationGroups(scopeId, ReadIdentityOptions.EXTENDED_PROPERTIES, propertyNameFilters, IdentityPropertyScope.BOTH);
error message:
java.lang.NullPointerException
at com.microsoft.tfs.core.clients.webservices.IdentityManagementService2.listApplicationGroups(IdentityManagementService2.java:92).
davy -
PS: How to get the hierarchy of a level 1 WBS only?
Hi,
This corresponds to Projects System module.
If we have 5 level 1 WBS elements.Out of them if I want to get only the WBS hierarchy corresponding to a level 1 WBS element (say 2nd level 1 WBS element).
I know that we can get all the WBS elements' hierarchy from BAPI_PROJECT_GETINFO. But I want the hierarchy for only one level 1 WBS element not for all. How?you could read them from SETNODE table with SETCLASS = '0110'
-
How to get available quantity in Inventory levels for all materials
Hi..All
I am Abap Developer and i have a Requirement that to Print a report that Displays " Inventory levels (available quantity) for all materials"
1) What tables can i use to retrive the data to get the Inventory levels (available quantity) for all materials.
2).What are the fields can used in that tables that use ful for end user.
Thank you,
Madhu .
Edited by: madhubabu rao on Oct 15, 2008 9:10 AMHi,
I'm not sure what you mean when you are speaking about inventory levels and available quantity.
I mean that you may have stock of 100 pcs of a certain material but from an open PrdOrd can come a reservation for this component (e.g. 20 pcs) that reduces this the available quantity (to 80 pcs).
If you want only the stock levels, you don't have to write any ABAP code, since MB52 report is designed for this purpose.
If you want to know the available stock (considering requirements (PIR, DepReq, SO), and stock-like MRP elements (PldOrd, PurReq, PrdOrd, PO, etc)) you should check report MD04 and examine how it works, which tables it uses (ST01).
http://iorboaz.blogspot.com/2005/04/get-md04-data.html
Regards,
Csaba
Edited by: Csaba Szommer on Oct 15, 2008 9:34 AM
Edited by: Csaba Szommer on Oct 15, 2008 9:34 AM
Maybe you are looking for
-
How do I update my iTunes on my iPad?
I am receiving: "The iPad "JG's iPad" cannot be used because it requires iTunes version 10.7 or later. Go to www.itunes.com to download the latest version of iTunes. I have to do as suggested but the reply I receive is that the software is already i
-
Hi all. while executing the AIBU, following message is diaplayed Balance in transaction currency Message no. F5702 Diagnosis A balance has occurred in transaction currency 'INR' with the following details: Exchange rate '00', amount ' 340.000,0
-
Trying to find broadband account details...
Hi there I'm trying to help my parents with their BB. They have an online account that has their telephone info in it, but not their BB, which is also BT. I have tried all passwords, usernames etc, as assume it must be in a different account somewhe
-
The Agent don't recognise Ldom.
I installed the Agent och a Solaris10 Primary ldm, First time Fine.. found the guest ldoms and everything looked OK.. Ater couple of days the Primare ldm vanish.. I notice that I had a old firmware,, prtdiag hangs.. So upgraded the fw and it worked a
-
Navigation Tag Library in Consumer Portal of Federated Portal Network
In a FPN scenario, is it possible to use the Navigation Tag Library in the consumer portal for the top level navigation? I have developed a custom top level navigation based on the navigation tag library, but when navigating to the role of the produc