How to show current date in a column of dimension table in ssas

Hi,
I have 2 dimension tables (ALLWORK and YOURWORK) and 1 measure table (STATS). In ALLWORK dim table, I have 4 columns, one of them is END_DATE. Based on END_DATE and current date I want to create a named calculation field. To achieve this, I
want to show the current date in 5th column (of ALLWORK dim table) as calculated member (as named calculation wont show me correct date).
Problem is, I am not able to create the column in the dimension table. While creating the calculated member, I am not able to select the ALLWORK dimension table, it always selects MEASURE by default. Please help.
thanks
Tarique
thanks and regards Tarique Aslam

Hi Tarique,
According to your description, you want to add a column to your dimension to show the current date, right?
In data source view, we can add named calculation to your table. A named calculation is a SQL expression represented as a calculated column. This expression appears and behaves as a column in the table. A named calculation lets you extend the relational
schema of existing tables or views in a data source view without modifying the tables or views in the underlying data source.
Reference
http://msdn.microsoft.com/en-in/library/ms174859.aspx
http://devmau5.wordpress.com/2010/03/25/the-getdate-of-mdx/
If I have anything misunderstand, please point it out.
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How can I take data from specific column in a table using VBA

    Hi
    I do not know how to take the values from the last column in a table, I know how to look over each row but I cannot take the last column values for each row I pass by.
    This is the table for example:
    | Date | Account1 | Account2 | Description | Amount |
    |12/03/2008 | 123-32 | 325-78 | None | $50 |
    |12/03/2008 | 123-32 | 325-78 | None | $20 |
    |12/03/2008 | 123-32 | 325-78 | None | $10 |
    |12/03/2008 | 123-32 | 325-78 | None | $40 |
    I am using this code as a reference that User FiveNines gave me to loop through all the rows in the table, so What I need is to take the values of the column Amount for each row I go through.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
    If tblRow.innerText = strValue Then
    RSWApp.WriteToLog "Tables", "Passed", "Row is Present", True
    End If
    Next
    End Sub

    Hi Lippix.
    This is code that will loop the rows then loop the cells and check for "$" which will return dollar values. I also attached a script.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
      For Each tblCell In tblRow.cells
      ' cycle through the cells and only report those with a dollar value by searching for $
        If InStr(1, tblCell.innerText, "$") <> 0 Then
       RSWApp.WriteToLog tblCell.innerText
       End If
      Next
    Next
    End Sub

  • Show Current Date in Year Format (and now - 1, etc.)

    Our form has some column headers that need to change each year, the headings are current year (2010) + previous 3 years.  Am trying to programatically add the titles to eliminate modifying the form just to change the year, but not finding how to accomplish, and was checking out some date samples found, but no success yet.  My question is 2 part - how/where do I put code, I don't need the user to enter anything, just want a column header.  This example below is where I copied the idea from a sample and tried to adjust, it's on the calculate event of a date/time field, and I get an error message that says 'the display pattern "date-{MM/DD]" is incompatible with the object's data format.  Define a compatible Display pattern.  This display pattern error is the 2nd part of the question.  How do I display only the 4 digit year?
    year1.rawValue
    = num2date(date(), "YYYY")
    How do I accomplish this - am newbie on this!  Thank you very much!

A: Show Current Date in Year Format (and now - 1, etc.)

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How to show current year and last year sales in a WEBI Report

    Hi Guys
    How can show current YEar Sales in one column and Last YEar Sales in the other column based on a user prompt for the Current YEar Column.
    For Example is user enter 2010 for Year how can i show a Column for Sales-2010 and Sales 2009.
    Thanks

    If you can modify your Universe add an object named New Object Last Year whose SQL is:( yourTableName.Year + 1)
    Then in WebI create two distinct queries in your query Pane. In the first one you could do this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:   Year Equal to '1. Prompt Year'
    Query 2:
    objects: Year, Sales ... etc.
    filters:    New Object Last Year Equal to '1.Prompt Year'
    Then in your report you can drag each object on their respective columns.
    If you don't want to use two distinct queries, use one like this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:        Year Equal to '1. Prompt Year'
                 Or
                      New Object Last Year Equal to '1.Prompt Year'
    Edited by: PadawanGirl on Jun 23, 2011 6:28 PM

  • How to view current  date and time on SAP screen

    Hi Everybody,
    How to view current  date and time on SAP screen .I have set time zone in T-code STZAC.now iam getting correct date n time in my tranctions but i want to check without any tractions
    Plz repay,Regards,
    Sadik.

    Hi,
    You can check the time by running a report .
    It will show the database and central instance time : Report name :rsdbtime
    Thanks and Regards
    Vijay kumar G
    Edited by: vijay kumar gopal on Mar 4, 2008 1:09 PM

  • How to show a data in Higher fonts with write statement

    Hi.
    how to show a data in Higher fonts with write statement
    I want to show a statement in large fonts with write statement.How can I do that.
    write : 'Company Address'.
    Regards
    Mave

    Mave,
      I would precribe you to use the FORMAT options available with the WRITE Statement.
    Because this allows us to differentitate between the HEADIngs and the LINEs in the report.
    Here u go dear:
      http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9e7135c111d1829f0000e829fbfe/frameset.htm
    Thanks
    Kam

  • How to show only date in BO webi 3.1 text box

    how to show only date in BO webi 3.1 text box for e.g:-
    01/01/2005  (no time only date)

    hi,
    just check by which format your date is coming
    just create a one variable and check =UserResponse("Transaction Date From (mm/dd/yy)")
    if your output is in format of("mm/dd/yyyy hh:mm:ss a")
    then some format we have to write in todate syntax
    then your final formula for date would be
    =FormatDate(ToDate(UserResponse("Transaction Date From (mm/dd/yy)");"mm/dd/yyyy hh:mm:ss A");"dd/mm/yyyy")

  • APEX CSS - How do I get data in report columns to wrap?

    I found information here http://www.orafaq.com/wiki/APEX_FAQ
    About How do I get data in report columns to wrap?
    This works and another way to do it is by adding the CSS directly into the
    Home>Application Builder>Application 137>Page 1>Report Attributes>Column Attributes page
    in the Column Formatting area. I added 'white-space:normal' and this works in FF but in
    IE it has a different behavior.
    In FireFox
    testasdgadhad
    gadfadgadgadg
    adgafhsrgjsgnsfg
    nsdfbadfafhafha
    dfhadfh
    In Internet Explorer
    testasdgadhad gadfadgadgadg adgafhsrgjsgnsfg nsdfbadfafhafha dfhadfh
    Is there a way to force it so it display in IE the same way that it displays in FF?
    The correct display format is FF.
    Thanks,
    Nestor :)

    I have try this because I found it during a search and it makes no difference in IE.
    This is what I am using now 'display: block; width: 100px;max-width:100px;white-space:normal'
    I also tried 'display:block; width:500px'
    If I use the values 'normal' or 'pre' for white-space' it works in FireFox but not in IE, The display block
    does not seem to make a difference. It seems that all I need is 'white-space:normal' but again
    it does not works on IE.
    Thanks,
    Nestor :-)

  • How to display current date in query header?

    Hi,
    How to display current date in query header?
    I use Query Designer for development.
    Thanks,
    Arun KK

    Hi Arun,
    You can define fixed header lines and footer lines so that when you generate the query list, they can receive current values of certain fields. When you define a header line or a footer line, you must specify a character string of the type &field, where field is the short name of a field.
    This function allows you (for example) to place a sort criterion in the header line.
    You can include the following fields as variables in the headers directly:
    %NAME
    Name of the user processing the query
    %DATE
    Current date
    %TIME
    Current time
    %PAGE
    Current page number (6 characters)
    %P
    Current page number (3 characters)
    These fields can be used in the short forms N,D,T and P. If you want to use these letters as short names for query fields, the field values from the query are used.
    You can also see the link
    [http://help.sap.com/saphelp_nw70/helpdata/EN/6e/dd68721faf11d6b1d500508b6b8b11/frameset.htm]
    Regards,
    NR

  • How to get current date for posting date

    hi,
    how to get current date for posting date ? any sample code ?
    Thanks

    Hi......
    Use
    Select getdate()
    for current date.......
    Regards,
    Rahul

  • Calendar today doesn't show current date, it's now 23rd of Nov 01:03 in Beijing, but  Today button of Calendar itself shows "today" as 22nd. So does the Calendar of Yosemite

    Calendar "today" doesn't show current date, it's now 23rd of Nov 01:03 in Beijing, but Today button of Calendar itself shows "today" as 22nd. So does the Calendar of Yosemite.
    Is it a bug?

    Sorry for the huge chunk of code.
    Mm, yes, I'm far too lazy to read all that.
    But you should be overriding paintComponent(), not paint().
    http://www.google.co.uk/search?hl=en&q=java+swing+painting&btnG=Google+Search&meta=
    I've not bothered to work out from that pile of magic numbers exactly what you're tring to draw but is it not something that JTable would happily do?

  • Display of data on as columns in a table

    Hi All,
    I have an application where the data from R/3 server is displayed on the table.
    The different columns are:
    1. Date 2. Volume 3. Price
    the Volume is corresponding to the date mentioned. which is in past/or future.
    I have to read the difference between current date and the column date in days. and multiply that with a price factor( to be read from the server ) and add it up with price on current day( to be read from server) and display it under the column "price".
    there can be many rows with many different dates and different corresponding price factors.
    Can some one tell me how to go about this.
    Thanks in advance
    Srikant

    Hi to  All(& Nibu)
    I have written functions:
    1.  Executing the The Bapi
    2.  finding the difference the between dates in days.
    3.  finding the price
    The following are the codes for them:
    public void executeZs_Wcontract_Quantity_Input( )
        //@@begin executeZs_Wcontract_Quantity_Input()
            try
                 wdContext.nodeZs_Wcontract_Quantity_Input().currentZs_Wcontract_Quantity_InputElement().modelObject().execute();
                 wdContext.nodeOutput_Contract_Qty().invalidate();
            catch(WDRFCException ex)
                 ex.printStackTrace();
        //@@end
    public int daysDifference( java.lang.String startDate, java.lang.String finishDate )
        //@@begin daysDifference()
        try
             SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
             Date beginDate = dateFormat.parse(startDate);
             Date endDate = dateFormat.parse(finishDate);
              GregorianCalendar calStart = new GregorianCalendar();
              calStart.setTime(beginDate);
              GregorianCalendar calEnd = new GregorianCalendar();
              calEnd.setTime(endDate);
                   //if the dates belong to same year
                   if (calStart.get(Calendar.YEAR) == calEnd.get(Calendar.YEAR))
                   return calEnd.get(Calendar.DAY_OF_YEAR) - calStart.get(Calendar.DAY_OF_YEAR);
                   else if ((calEnd.get(Calendar.YEAR) - calStart.get(Calendar.YEAR)) == 1)
                             int daysEndYear = calEnd.get(Calendar.DAY_OF_YEAR);
                             int daysStartYear = calStart.getActualMaximum(Calendar.DAY_OF_YEAR) - calStart.get(Calendar.DAY_OF_YEAR);
                             return daysEndYear + daysStartYear;
                        else
                                  int startYear = calStart.get(Calendar.YEAR);
                                  int endYear = calEnd.get(Calendar.YEAR);
                                  GregorianCalendar cal = new GregorianCalendar();
                                  int days = 0;
                                  for (int i = startYear + 1; i < endYear; i++)
                                                 cal.set(Calendar.YEAR, i);
                                                 days += cal.getActualMaximum(Calendar.DAY_OF_YEAR);
                                                 days += calEnd.get(Calendar.DAY_OF_YEAR);
                                                 days += (calStart.getActualMaximum(Calendar.DAY_OF_YEAR) - calStart.get(Calendar.DAY_OF_YEAR));
                                  return days;
         catch (Exception e)
         return -1;
        //@@end
    public void calFixedPrice( )
        //@@begin calFixedPrice()
                 int max = wdContext.nodeZs_Wcontract_Quantity_Input().nodeOutput_Contract_Qty().size();
              //wdContext.currentContextElement().setCFlag("Srikant");
                  for (int fixedCounter = 0; fixedCounter<max; fixedCounter++)
                  Date presentDate = Calendar.getInstance().getTime();
                   Date givenDate = wdContext.nodeZs_Wcontract_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Schedule_Lines().getLi_Schedule_LinesElementAt(fixedCounter).getSchddt();
                      //Conversion of the Dates in String
                           String PresentDate = presentDate.toString();
                           String GivenDate = givenDate.toString();
                      //Calculation of no. of days
                           int numDays = daysDifference(PresentDate,GivenDate);
                           double Days = numDays;
                      //Getting the Values of Current Price for the Day and Fixed Price Factor based on that
                              double quotedPrice = (wdContext.nodeZs_Wcontract_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Post_Id_Price().getLi_Post_Id_PriceElementAt(fixedCounter).getPrice().doubleValue());
                           double fixedPriceFactor = (wdContext.nodeZs_Wcontract_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Fixed_Factor().getLi_Fixed_FactorElementAt(fixedCounter).getFixfactor().doubleValue());
                        //wdContext.currentContextElement().setCTest(fixedPriceFactor);
                      //Calcualtion of Fixed Price
                           double FixedPrice = (quotedPrice + (fixedPriceFactor * Days));
        //@@end
    I'm not able find out where to use these methods and how to call them
    Please help me on this, its urgent
    Thanks in advance
    Srikant

  • Get frequent data for each column of a table

    What is the best way to get the most frequent data in each column of a table.
    we have around 25 tables and each table has around 20 columns , so rather than writing group by for each column of table , is there any easy way to find this?
    example we have table
    Column A       Column B         Column C
    Apple             Monday             Red
    orange            Tuesday            Green
    Apple              Monday            Red
    Lemon            Wednesday       Green
    Apple               Thursday         Red
    in this table, column A's frequnt data is Apple , column B's frequent data is Monday , Column C's frequnt data is Red
    Apple 3          Monday 2                  Red 3
    Orange 2        Tuesday 1                 Green 2
    Lemon 1          Wednesday 1         
                          Thursday 1
    Group by kind of query will give this result, but with 20 tables each having 20 - 30 columns if we need similar kind of result ..  is there any way to get this data.

    Hi,
    GROUP BY (using aggregate functions) is the best way to do what you described.
    PIVOT and UNPIVOT are probably what you'd want in this case.  The phrase "GROUP BY" may not actually appear in your code, but you'll essentially be doing a GROUP BY.
    Analytic functions (rather than aggregate functions) can do the job, too, but they'll be less efficient.  Analytic functions get you results about the groups, without losing each row's identify, but in this case, losing each row's identity is eactly what you want to do.  You only want 'Apple' to appear 1 time, not 3 times.
    The fact that you need to do the same query on 20 different tables suggests that there's something wrong with your table design.  Wouldn't it be better to have 1 big table, with a new column that has 20 unique values instead?
    I hope this answers your question.
    If not, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Simplify the problem as much as possible.  For example, instead of posting a problem with 20 tables, each having 25 columns, post a similar problem involving, say, 2 tables, each with 3 columns.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • Maybe you are looking for

    • Adding day of week to iCal calendar

      I am frustrated by the fact that iCal does not show the day of the week above the dates  My iCal is set to show one week at a time but only shows July 17, 18, 19 etc.  Is there a way to modify an iCal calendar or is there a page already in iCal.  I w

    • JQuery in Apex 4.0

      Hello All, I want to create a accordion in my application by using the jQuery components, I followed some Threads also but it still not working. This is the thread I am following: Roll Your Own - APEX 4.0 and JQuery-UI Application Here the example gi

    • Anonymous access with named users

      Hi! I am trying to set up anonymous access with named users on EP6 SP9. I am using Database only as UME Data storage. I have applied the note #728106, since most of the content is html-pages on the KM. I defined the UME settings ume.login.guest_user.

    • Mobile App Challenge 6/17/2013 - 7/01/2013

      MOBILE CHALLENGE CONTEST INFORMATION This Contest opens on February 11th, 2013 with a new challenge every two weeks until July 31st  2013. What is a stream cipher? A.     Cipher that encrypts a byte at a time B.     Cipher that encrypts a block at a

    • How do I get my newly purchased music from my computer to my ipod

      How do I get my newly purchased music from my computer to my ipod ??