Simple MDX : Associated Date Value for returned week number on Row Axis ?
Team , I have this MDX Below :
I'm trying to see if i can also have a Column which Uniques the week Starting/Ending Date as below , Thanks in advance for your help and time .
1 20040101 20040101 20040103 (null)
1 20040102 20040101 20040103 1
1 20040103 20040101 20040103 (null)
2 20040104 20040104 20040110 (null)
2 20040105 20040104 20040110 1
2 20040106 20040104 20040110 1
2 20040107 20040104 20040110 (null)
2 20040108 20040104 20040110 (null)
2 20040109 20040104 20040110 (null)
2 20040110 20040104 20040110 (null)
Rajkumar Yelugu
Hi Rajkumar,
According to your description, you want to show the week start and week end date together with the date dimension members, right? In this case, you can add week start and week end attribute to date dimension. Adding Week Start and Week End dates to your
Date Dimension table can make navigating your dimensional model extremely handy and tasty to the end user. Please refer to the link below to see the detail information.
Calculating Week Start and Week End Dates Dynamically
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support
Similar Messages
-
How to fetch year till date value for earning for current ,last and year
hi,
how to fetch year till date value for earning for current ,last and year before that from payroll result
plz reply soon,
pratyushDear Pratyush,
Pick this from CRT.
Use LDB PNPCE & Fire event GET PAYROLL &
then you can pick from CRT.
Hope this helps.
Kindly reward in case useful.
Regards & Thanks,
Darshan Mulmule -
How to avoid the Amount and Date values for VOID Cheques
Hi All,
I had created a two window i.e For Amount and Date. If I process the cheque the Amount value and Date should not trigger for VOID CHEQUES.
Can any one tel me how to avoid the Amount and Date values for VOID Cheques
Your help will be greatly appreciated.
Regards
YathishHi,
I dont know which tablel you are referring to, is it PAYR table and the field VOIDR?
If a cheque is voided, it would have a reason and it is stored in VOIDR field of this PAYR table.
Check if the field VOIDR is filled, if it is filled, do not print the amount and date.
Regards
Subramanian -
Return specific number of rows depending on the data in a column in table
Hi,
I have a table named orders which has column orderid and noofbookstoorder in addition to other columns.
I want to query the orders table and depending on the value of the 'noofbookstoorder' value return that number of rows.
Eg
Orderid noofbookstoorder
1 1
2 3
3 2
when I query the above data saying
select * from orders where orderid=2;
since it has noofbookstoorders value as 3 the query should return 3 rows and when I query
select * from orders where orderid=3;
it should return 2 rows and
select * from orders where orderid=1;
should return 1 row.
Is it possible to achieve this. If yes, then how do I write my query.
Thanks in advance.with t as (
select 1 Orderid,1 noofbookstoorder from dual union all
select 2,3 from dual union all
select 3,2 from dual
select t.*
from t,
table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
where Orderid = <order-id>
/For example:
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
9 where Orderid = 2
10 /
ORDERID NOOFBOOKSTOORDER
2 3
2 3
2 3
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
9 where Orderid = 3
10 /
ORDERID NOOFBOOKSTOORDER
3 2
3 2
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
iNumberList))
9 where Orderid = 1
10 /
ORDERID NOOFBOOKSTOORDER
1 1
SQL> -- And if you want to select multiple orders
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
iNumberList))
9 where Orderid in (2,3)
10 /
ORDERID NOOFBOOKSTOORDER
2 3
2 3
2 3
3 2
3 2
SQL> SY.
Edited by: Solomon Yakobson on Oct 26, 2009 7:36 AM -
Get week ending date from Year and Week Number
I would like to display the week ending date in a Report.
My dataset query has grouped the results by year and week number, so I am trying to construct the week ending date from year and week number.Week end date can be got as below
=DateAdd(DateInterval.WeekOfYear,CInt(Fields!WeekNumber.Value) -1,DateAdd(DateInterval.Year,(Cint(Fields!Year.Value) - 1900),CInt("12/31/1899")))
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
How do i get the date when enter a week number
Hi, can anyone tell me how do i get the date when enter a week number??
let say, i enter week number 4 and year 2008
result=26-01-2008
thanks..import java.util.Calendar;
public class testCalendar {
public static void main(String args[]){
int year=2008;
int week =5;
Calendar now=Calendar.getInstance();
now.set(Calendar.YEAR,year);
now.set(Calendar.WEEK_OF_YEAR,week);
System.out.println(now.getTime());
hai, anyone know why i can't get the result:27-01-2008
i always get two day later. That is 29-01-2008
no wonder how i change the week number and year.
for example: week=7, year=2007
expected result:11-02-2007
but the result is 13-02-2007
thanks..
Edited by: Angel_Wei on Sep 1, 2008 11:58 PM -
Revision: 2093
Author: [email protected]
Date: 2008-06-16 12:57:18 -0700 (Mon, 16 Jun 2008)
Log Message:
fix air-config.xml so that there are no hard-coded values for the build number. This gets updated from the root build.xml by using a combination of a value from build.properties, release.version, and a value passed into build.xml build.number.
partial fix for sdk-15812
Ticket Links:
http://bugs.adobe.com/jira/browse/sdk-15812
Modified Paths:
flex/sdk/branches/3.0.x/frameworks/air-config.xmlI need to add just one more thing and that is on battery life. Last night I sat with the rMBP on my lap installing software, surfing the web, answering emails for close to 4 and 1/2 hours. At the point I took it back to the charger it still was showing a computed battery time remaining of 3.5 hours.
Today I had two VMs open and took the machine of the charger and sat outside with my dogs for about 30 minutes. During this time I was working in both VMs, editing and compiling code. My battery life estimate showed a good solid 4 hours.
This is roughly 6 times greater than what I had with my 2010 MBP and it too had a SSD. I am not sure why but this retina MBP just seems to not work as hard doing anything that caused my 2010 MBP to struggle.
While the battery life is certainly better than I expected it is clear that load can change that very rapidly. So I think I still need to visit clients with an external battery or charger in hand. But I don't think I will be quite so scared that my laptop will simply run out of power before I can even get it plugged in. -
How do you return the number of Rows in a ResultSet??
How do you return the number of Rows in a ResultSet? It's easy enough to do in the SQL query using COUNT(*) but surely JDBC provides a method to return the number of rows.
The ResultSetMetaData interface provides a method for counting the number of columns but nothing for the rows.
ThanksNo good way before JDBC2.0. u can use JDBC2.0 CachedRowSet.size() to retrieve the number of rows got by a ResultSet.
-
Loop through a csv file and return the number of rows in it?
What would be simplest way to loop through a csv file and
return the number of rows in it?
<cffile action="read" file="#filename#" output="#csvstr#"
>
<LOOP THROUGH AND COUNT ROWS>ListLen(). Use chr(13) as your delimiter
-
Return the end of week date using month and week number
Hi all,
I am trying to find the date for end of the week using given month (201401, 201402...i.e, 2014 is year and 01,02 are months) and week number (01,02,03...) for the year. For example if my month is 201402 and week_number is 06 then it return the week_date
as 2014-02-08. Can you please help me in writing a sql statement for this scenario.
Thanks in advance,
NikhilCurrent month is irrelevant
with dt as (
select dateadd(day, (6-1)*7, '2014-01-01') as xwk
select dateadd(day, 7-datepart(weekday, dt.xwk), xwk)
from dt;
Change the "6" in the with statement to the week of interest and 2014 to the year of interest... -
Continuation: need data grouped for every week
SELECT * FROM aetnah_file_emp_cust_hist
WHERE pctl_employee_seqnum= 133774This query returns too many rows.
Now my requirement is that I need to get the most recent contrib_amt from this table for every week based on date column CTL_INS_DTTM.
This column CTL_INS_DTTM stores data about when a row wass inserted into this table.
pctl_employee_seqnum CTL_INS_DTTM(MM/DD/YYYY) contrib_amt
133774 01/01/2009 100
133774 01/02/2009 200
133774 01/03/2009 300
133774 01/04/2009 400
133774 01/05/2009 500
133774 01/06/2009
133774 01/07/2009 700
133774 01/08/2009 800
133774 01/10/2009 900
133774 01/12/2009 1000
133774 01/13/2009 1100
133774 01/14/2009 1200
I will need 52 columns (1 year = 52 weeks) totally and the most recent data for each week.
Ex:
Desired output:
01/07/2009 01/14/2009 01/21/2009 01/28/2009
700 1200 NULL 200
SELECT pctl_employee_seqnum, CTL_INS_DTTM, contrib_amt
FROM (
SELECT pctl_employee_seqnum, CTL_INS_DTTM, contrib_amt, ROW_NUMBER() OVER(PARTITION BY TO_CHAR(CTL_INS_DTTM, 'WMONYYYY')ORDER BY CTL_INS_DTTM DESC) RNO
FROM aetnah_file_emp_cust_hist
WHERE pctl_employee_seqnum= 133774
WHERE rno = 1This code above is doing that but I need to transpose this row wise data into column wise as mentioned on Desired output.
Total # of columns:52
Apologize for opening a new thread.....please help on this transpose issue
Thank You AllHi,
TO_CHAR (ctl_ins_dttm, 'WMONYYYY') will result in 59 or 60 groups per year, since all months (except February in common years) have (incomplete) 5th weeks.
If you want 52 equal-sized groups, then TO_CHAR (ctl_ins_dttm, 'WWYYYY') will get you closer. (You'll still have an incomplete week 53.)
To pivot those rows into one column, you can do something like:
SELECT MAX (CASE WHEN TO_CHAR (ctl_ins_dttm, 'WW') = '01' THEN contrib_amt END) AS week_01
, MAX (CASE WHEN TO_CHAR (ctl_ins_dttm, 'WW') = '02' THEN contrib_amt END) AS week_02
, MAX (CASE WHEN TO_CHAR (ctl_ins_dttm, 'WW') = '03' THEN contrib_amt END) AS week_03
, ...If you want data (like "01/07/2009") as the columns headers, then you'll have to use dynamic SQL. -
How to parse the date value for the string 2003-04-25 11:53:11 IST
This is my database output for the date value(2003-04-25 11:53:11 IST). How to convet this string to Timestamp date value. Any one pl. help me
BUT ... there is a public static Timestamp valueOf(String s) method in the Timestamp class that might help.
http://java.sun.com/j2se/1.4.1/docs/api/java/sql/Timestamp.html#valueOf(java.lang.String) -
Using data values for member selection
Hello everybody:
I know there are functions to operate with members, strings, member names, ... so that you are able to convert from a string to a member (@MEMBER) and conversely.
But, is there any way to use a member value to select another member?. For example, if in the account dimension I have a member "parent" with value '100'. Could I save in the member '100' a value, using the '100' saved value in "parent" to select that member. So if its value is '200', I should save in member '200'.
Thank you
Regards,
JavierHello CM:
I apologize for the description :(.
There are three indicators: "InitDate", "EndDate" and "Parent". There is another dimension with three members: "1", "2" and "3" with these data:
"Parent" "InitDate" "EndDate"
"1" "Missing" 20120101 20120301
"2" "Missing" 20120201 20120228
"3" 1 "Missing" "Missing"
My intention is that "InitDate" and "EndDate" for "3" were values taken from member "1" based on "Parent" value for "3".
So my question was related to create this formula:
"ID" (
IF ("Parent" <> #Missing)
"InitDate" (current member) = "InitDate"->@??????("Parent");
"EndDate" (current member) = "EndDate"->@??????("Parent");
ENDIF;
That is, being able to recover value "1" in "Parent"->"3" to create cross-dimension "InitDate"->"1" and "EndDAte"->"1".
The problem is that I do not know how to recover a cell value (data) and use it for creating a member name. I think that functions like @NAME, @MEMBER, @ALIAS ... are based on using atributtes, strings, @CURRMBR functions and others, but not for values stored in that members.
I hope this helps you to understand better what I mean.
Thank you
Regards,
Javier
Edited by: Javi M on 25-May-2012 02:17 -
Not getting proper date values for original GI Date
Hi,
I have to Calculate Original GI Date based on Original promise Date and transport Date(Original GI Date = Original promise Date-transport Date) and I am getting Original Promise date as"21112008" and transport date as"20112008". when I subtract in Update rules as formula as (Original promise Date-transport Date) getting Original GI DATE as"01000001" as it is giving wrong date values.please help me whether i am going right way or is there any thing else i have to select in Update rule level (formula) to get proper date values or how can i approach to get original GI date.
it is QUITE Urgent...please help any one to solve the Issue.
REGARDS
VENKAT.Hi Venkatesh,
Please search SDN forum before you post any questions. There are lots of threads available for this scenarios.
Use formula variables in Bex in order to achieve your requirement.
Links below, may be helpful:
Formula variable with replacement path on system date
How to creae days count variable in SAP BI-BEx
http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/frameset.htm
Regards,
Ravi Kanth. -
Can we have -ve freight value for return Purchase order
Hi All,
we have a scenario for returns PO where we need to reverse the freight.
Please suggest if SAP supports this in standard,
We tried to influence it though condition routine, but the value get updated in table KONV without negative sign.
Please suggest.
Thanks and regards,
VithalprasadDear Umakanth,
I'm actually struggling to solve this issue that you've discussed here. Because the vendor is agreed to allow us to reclaim the freight charges. Our user is requested to show the "freight charges return" in the "PO return". I've tried couple of ways to work on the condition type. But, it doesn't give me what I wanted. e.g. The amount for the cost of material to be returned is $100 and the freight charges is $20. We are actually expecting to have the PO return's total net value at $120 instead of $80. However, no matter how I tried, the system either give me $80 or if I managed to enter and got the value at $120-, but the system will throw me an error message of "PO item does not accept any negative value for delivery cost".
What should be the right way or the best practice to handle this issue?
1. Shall I enhance any specific characteristic in the condition type? or;
2. Shall I create another PO line item purely for the freight charges (reclaim)? If so,
shall I post to item category "K"? or;
3. Shall I let the FI to handle the credit memo manually (meaning the freight charges do
not capture in the PO return at all)
I'm so sorry to disturb you via your email. However, I'm new to this forum and I finally found your valuable recommendation to one of this question. I do need more info on your suggestions urgently.
Thank you so much for your time. Appreciated.
Regards,
Edwin Fu
[email protected]
Maybe you are looking for
-
When printing a web page, I only get blank pages
I have a new iMac with MAC OS 10.4.11. I connected an HP psc 2175xi all-in-one printer, and when I try to print a web page from Safari, I only get a very small portion of the header and all other pages are blank. When looking at the Print Preview, ev
-
hi I AM TRYING TO CREATE A CUSTOM IN ABAP I followed the following procedure SE11 SPCIFIED THE CUSTOM TABLE NAME CLICKED ON CREATE BUTTON THEN SPECIFIED SHORT DESCRIPTION For Delivery Class I specified as C For DataBrowser and Table variant I specifi
-
Exit Button not working in ESS
Hi All, We have configured ESS in our landscape. When I go to any Overview/Edit/Review Page (in W-4 Tax, Add/Change dependents etc..), the Exit button which is present is not working. When I click the Exit button, it doesn't exit the current view, b
-
Using Formulas and Variables To Count Rows That Meet Certain Conditions
I have a web intelligence report designed that shows results of shipments that arrived and departed in a given period and the mode of transport (air, ocean, motor). I've tried building formulas to give me counts for example of the number of shipmen
-
Solution to Errno:7 in MaxL for Essbase Studio redeployment scripts
This is an answer to an archived forum post that I found via a Google search. The forum post no longer accepts replies. The forum post contained an unanswered question about how to resolve "Errno:7" in MaxL in release 11.1.2.3 when trying to redepl