Format field in DMX query

Hi
Does anyone know how to write a FORMAT DATE in DMX query ?
I have a date in USA format and I want to change it to UK format like “mm/dd/yyyy” to “dd/mm/yyyy”
and changing some dates to be full dates like 01/01/2015 not 1/1/2015
my query is:
SELECT
LAST_DATA_UPDATE,
now()
as NowDate
 FROM $System.MDSCHEMA_CUBES
where
cube_source = 1
Thank you
Yoni.

Hi Yoni ,
Hope the next code will be handy :
SELECT
format(LAST_DATA_UPDATE, 'dd/MM/yyyy') as Date1,
format(LAST_DATA_UPDATE, 'MM/dd/yyyy') as Date2 ,
now() as NowDate
FROM $System.MDSCHEMA_CUBES
where cube_source = 1
Regards, David .

Similar Messages

  • MDX query with a DMX query

    Hi All,
    Do I have a way to run a MDX query with a DMX query? (Avoiding the “link server” options… )
    I need to get the cube last update date like this DMX query:
    SELECT 1
    as CubeStatus
    FROM $System.MDSCHEMA_CUBES
    where 
    format(LAST_DATA_UPDATE,
    'dd/MM/yyyy') = format(now(),
    'dd/MM/yyyy')  --"1" means that the cube was processed, NULL cube did not process today
    and cube_source = 1
    and cross reference it to a result I get from this MDX query:
    with
    member measures.LastDateCube
    as [Comm Date UTC].[Date].currentmember.PROPERTIES("KEY")
    select measures.LastDateCube
    on 0 from comms
    the purpose of this is to know for sure that my current member (date integer) is equal to the cube last update date. thus, making sure the cube was processed and I get the correct member I expect.
    What do you think?
    Thank you
    Yoni.

    Hi yonibiel,
    According to your description, you want to combine a DMX query with a MDX query. Right?
    In SQL Server, it is not supported to parse the MDX query without connecting the SSAS database server. So if you want to combine the DMX and MDX query into one dataset, the only way is using linked server to SSAS in openquery() function.
    In this scenario, if you render these data from two result sets for reporting purpose, I assume you using SSRS, you can create two datasets and use lookup() to combine data fields from two datasets into one data region.
    Reference:
    Joining the results of two MDX queries together
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Data format in Ad-hoc query

    Dear All,
    We had created query which join table as below
    Addit. structures
    T500L INNER JOIN INNER JOIN T500P INNER JOIN PA0001 INNER JOIN CSKS INNER JOIN PA0000 INNER JOIN PA0007 INNER JOIN CEPC INNER JOIN CEPCT INNER JOIN PA9315 INNER JOIN PA0105
    1 When we execute and transfer to local file with DAT data format,
    - Company code would auto become 401 instead of 0401.
    - Hours weekly appear as 40,00 but we want the hours weekly download as 40.00
    May i know how i could solve this as we need this downloaded file to be upload to legacy system ?
    Should i create custom field to solve it ?
    Thanks and regards,
    AO

    I would output to SAP directory and the legacy system would FTP to get the file from there.
    There's no chance to format manually. Is it possible put ABAP code in Field code (In QUERY) to hardcode the company code as Character, so when download to xls, it would not change to numeric ?
    May i know which ABAP expect could help on this ? I not good in ABAP code.

  • DMX Query, the most influential variable

    Yours sincerely.
    I'm doing work of data mining using decision trees, and I have the expected result: Predicted probability of dropping out, however I would like the result, by DMX query, throw me the most influential variable in the above probability .
    For example if Marco, has a 90% chance of dropping out, tell me what was the most influential variable for this probability, which can be Sex, Age, City, etc..
    I have in my data mining model, named Tree, variables such as sex, age, marital status, district, etc., and my view of the data, Vista_Datos, fields such as customer name, phone, email, Prov.; so my query resulted DMX follows.
    Select
       (T. [CustomerName]) as [Customer]
      (T. [date]) as [Date of Appointment]
      t. [Department],
      t. [Province]
      t. [District]
      (T. [address]) as [Address],
      (T. [telephone]) as [Phone Fixed]
      (T. [Cell_Phone]) as [Cell Phone]
      (T. [email]) as [E],
      PredictProbability ([Tree]. [Desertion], 0) * 100 as [Probability of Defection]
    From
      [Tree]
    PREDICTION JOIN
      OPENQUERY ([Source Mining]
        'SELECT
          [CustomerName]
          [Date],
          [Department],
          [Province]
          [District]
          [Street address]
          [telephone]
          [Cell_Phone]
          [Email]
        FROM
          [Dbo]. [Vista_Datos]
        ') AS t
    ON
      [Tree]. [Department] = t. [Department] AND
      [Tree]. [Province] = t. [Province] AND
      [Tree]. [District] = t. [District] AND
    where (PredictProbability ([Tree]. [Desertion], 0) * 100)> 50
    I need to modify the query to get the most influential variable in the prediction result.
    I hope I have been clear so they can help me.
    Thank you for your attention.
      

    select * from [Model_Name].content
    returns you all the information about the model (all the nodes in the tree).
    select NODE_UNIQUE_NAME from [Model_Name].content where NODE_TYPE=2
    returns NODE_UNIQUE_NAME of the root node. If you want to find all children of the root node (all the first splits) you can execute query like
    select * from [Model_Name].content where [PARENT_UNIQUE_NAME]='000000004'
    where '000000004' is NODE_UNIQUE_NAME of the root node.
    Tatyana Yakushev [PredixionSoftware.com]

  • Results of DMX query

    I have this DMX query, which is written for Neural network model:
    select t.*, predict ([module])
    as [predictedvalue],vba!format
    (predictprobability ([module]),'Percent')
    as [probability] from [Neuronske mreže]
    prediction join openquery ([moodle baza],
    'select distinct Course from [dbo].[log] ')
    as t on [Neuronske mreže].[Course]=t.Course
    order by PredictProbability([Module]) desc
    And I get results, but just one Module for one Course. Even if I remove "distinct", results show more same results for one course.
    For example:
    Course        Predicted Value       Probability
    32                Forum                        95%
    But, on the course 32 there are more Predicted values, and I want to show them all, with their probability.
    How could I do it?
    Thank you in advance

    For this DMX, course 32 will only have one output.  If your original list has more than one course, then each individual course would have its own predicted value and probability.
    Mark Tabladillo PhD (MVP, SAS Expert; MCT, MCITP, MCAD .NET) http://www.marktab.net

  • Creation of local field in ABAP Query

    Hi
    Please let me know how to create a local field in ABAP query. I am finding the option inactive in SQ01.
    Regards
    Priyadarshini

    hi priya,
         *__Adding u201CLocal Fieldu201D (user defined field) in SAP Query_ :
    There is also facility to add the user defined fields in SAP query output. Also we can provide calculation formula for calculating values for this user defined field.
    Calculation formula consists of standard fields from standard SAP tables. So the values fetched for particular standard SAP fields from standard SAP tables get calculated as per the calculation formula defined for the user defined field and displays the value accordingly.
    To do this first go to change mode for Query which automatically takes you to screen shown below and click on icon   , as below :
    Then further screen will appears. So select the Field group and again click on the same icon button   .
    Then switch on the Short names for the fields and give the short names to fields which we need to use in Calculation formula.
    Give the short names and then created u201CLocal Fieldu201D, as shown in below screen shot. Also Short names are given to fields, which can be used further for calculation.
    Defining Local Field u201CREM_QTYu201D along with its field type and Calculation formula.
      In this case we have 
      defined field type for new  
      field as similar to
      ORD_QTY and
      Calculation formula is  
      defined.
    Also its possible to have Conditional logic for Local field by putting Condition in u201CConditionu201D line.
    Now activate this newly added Local field for coming it in output screen. To do the same again go to u201CBasic Listu201D and activate the Local Field as shown below :
    i think this will help u
    regards,
    sindhu.

  • Alignment and restriction of Custom field in SAP query report

    Hi Experts,
    I have one custom field in query report(SQ01) called Amount in local currency which is calculated based on Amount in document currecy * exchange rate.
    But this field values are coming in left alignment instead of right alignment so how i should get in right alignment and second issue is how i can restrict field value to only 2 decimals.
    I tried the below link "http://media.techtarget.com/searchSAP/downloads/SAP_Query_C7.pdf" but the steps they mentioned are not appearing in SQ01 for example in that link they mentioned to click Basic List option for advanced steps but when i click i goes directly to field list with field groups on left pane
    Please provide solution for this.
    Thanks&Regards,
    narasimha

    Hello narasimha,
    In the Infoset when you create the additional field, enter an existing SAP table field that has type CURR in the parameter labeled LIKE Reference.  For example you can enter BSAK-DMBTR as a value. When you select the additional field in the query, the currency will also show.
    Kind Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Apr 25, 2011 11:27 PM

  • Addition of checkbox and 2 fields in ABap query selection screen

    Hi
    I need to add chack boxes and 2 fields in ABAP query which is using LDB QMI. can u pls let me know how to do that.

    Hi Tarun,
    I am still not clear with the problem..I guess you require plant in your selection screen which you have.
    i guess if you go to sq01tcode there is a option infoset query from where you can give your selection options and value.
    have you selected all the fields in infoset and made a selection screen?
    When you have done with your infoset you just need to diplay the fields and there is a automatic program generated.
    Let me know...
    Regards,
    Nihkil.

  • Calculated field in a query

    Hi,
    To begin with I am just learning EJB and JAVA so please bear with me. I want to create a calculated field in a query from two fields in the table being queried, using SQL I would write the query like this:
    SELECT ledgerdate, description, quantity, unitprice, [quantity*unitprice] FROM ledger
    I have created a class called ViewLedger to contain my results, it has the following elements:
    DATE ledgerdate,
    STRING description,
    INTEGER quantity,
    BIGDECIMAL unitprice,
    BIGDECIMAL amount
    The query that I have been attempting that fails is:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, l.quantity*l.unitprice) FROM Ledger l
    The error says that there is an unexpected * in the query
    The following do not work either:
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, (l.quantity*l.unitprice)) FROM Ledger l
    The error says there is an unexpected ( in the query.
    SELECT NEW ViewLedger(l.ledgerdate, l.description, l.quantity, l.unitprice, [l.quantity*l.unitprice]) FROM Ledger l
    The error says there is an unexpected [ in the query.
    Any help would be greatly appreciated.
    Thanks.

    I don't think JPQL allows functions (*) in the SELECT clause.
    You can use a native SQL query as a workaround. If you are using EclipseLink or TopLink Essentials, you can also use a ReportQuery.
    You may also want to vote for the bug,
    [https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814|https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814]
    James : [http://www.eclipselink.org|http://www.eclipselink.org]

  • Add field in a query (logical data base)

    Hi,
    I want to add a field in a query .
    The data source of  its infoset is logical database .
    When i tried to drag and drop the field, the alv grid turned to alv list.
    Can you help me.
    thanks,
    Meriem.

    Hi Merim,
    As KAMESH mention,
    you can add  additional fields in your infoset and put the logic for that field in your infoset program and assign the same field in your existing group within infoset.
    once you assign the infoset and generate the infoset then your field will be reflected  in sap Query .
    you can add additional field in your output.
    Regards,
    Prasenjit Mishra

  • Additional fields in SAP Query

    Hi ,
    We have a requirement in HR reporting wherein we are providing the late attendance records of the employees. That is the person is scheduled to come at a respective time but he comes in late and this record is created in attendence infotype . Now we need to see the variance in his planned and actual arrival . Majorly all the fields are availabe in the Infosets but the one with the variance is not there . So do we need to create a custom report for the same or it can be handled in the SAP query adding one field for calculation. If it can be handled , how can that be possible .
    Thanks & Regards

    Please check this link:
    Re: query report
    I guess, it can help for your case too...
    Even this:
    Re: sap query infoset and fieldgroup
    Re: Additional field in SAP Query
    Kind Regards
    Eswar

  • Populating Additional Field in InfoSet Query

    Hello,
    My team and I are working on generating a relatively simple report from the VBAK (Sales Header), VBAP (Sales Items) and VEDA (Date data) tables.  We would prefer to be able to build an InfoSet (SQ02) and Query (SQ01) instead of writing a custom report.
    The problem is the VEDA table contains data that may link to the VBAK and sometimes the VBAP table.  The usage is that the header has begin and end dates for a contract, which is denoted by a blank value in POSNR field in the VEDA table.  If a particular line on a contract has different dates than the header, there will be an additional record in the VEDA table where the POSNR value matches the POSNR value from the VBAP (Item) record.
    The link to the VBAP table is straight forward being keyed off of the VBELN (doc number) and the POSNR (item number) fields in both tables.  However, there's isn't a POSNR field in the VBAK (header) table and the VEDA table shows this as a blank value in the POSNR field.
    The simplest thing I can think of doing is link the VEDA table to the VBAP and let it retrieve all the exact matches on Sales Doc & Item Number but add two "Additional Fields" to the Query that would represent the Sales Header begin and end dates.
    I know how to add an additional field but how would you "re-query" the VEDA table and under which option under the Code tab.
    Thanks

    Hi Alex
    Please see if below example helps you to understand:
    Supposing, we are displaying material description within our query.
    1. So we define the join with MARA & MAKT while creating infoset in transaction SQ02.
    2. We create feild groups to identify the fiels we use for selection and display.
    3. Here after selecting language key from MAKT, by default this will take SY-LANGU always for the case.
    4. To make it applicable for different languages we can code in INITIALIZATION Event.
    5. To do so we can do it by two options: Use menupath: Goto->Code->Initialization
    i) First option using variable: <b>MAKT-SPRAS = SY-LANGU.</b>.
    ii) Second option using Parameter-Id: <b>SET PARAMETER ID 'SPR' FIELD SY-LANGU</b>.
    6. Save & Generate.
    Now when we execute the query, we are defaulting the language as System Language.
    Hope the above info helps you for better understanding.
    Kind Regards
    Eswar

  • How to Substr field in SAP Query.

    Dear Developer,
    How to substr any field in SAP Query ?
    Regards,
    Ujed.

    Hi Ujed,
    if SUBSTR stands for substring, then possibly your question may be how to get the substr method as konown in languages like php in ABAP.  If SAP Query points to a SAP query as created in transaction SQ01, then you should explain what you want to achieve.
    Note: Better ask a specific question and get am answer you can or which is already generalized.
    If I need a substr function, I'd create a functional method for that:
    method substr
      importing
        anyfield type any
        offset type i
        length type i
      returning substring type string.
      try.
        substring = anyfield+offset(length).
      catch cx_root.
    * handle error
      endtry.
    endmethod.
    Regards,
    Clemens

  • ADDING SOURCE SYSTEM FIELD IN MY QUERY

    HI ALL,
    i WANT TO DEVELOP A CUSTOM REPORT WITH SOURCE SYSTEM FIELD IN MY QUERY WHICH THE FIELD IS NOT COMING FROM THE CUBE . PLEASE COULD SOMEONE HELP ME IN THIS REGARD.
    MAX PTS GIVEN
    REGARDS,
    AXEL

    Hi Axel...
    if yo want ot jump from a query to some R/3 report, pgm, transaction...you can use the report-report interface (RRI)...but if you want to add a field on the same screen of your query, you can go for a virtual char/KF: it's enough to add it in your cube, let it empty and fill it runtime with some ABAP lines with an RFC link to the table field you need...
    pay attention to performance issues and to the consideration that this field will be empty if your RFC fails (foe unavailability of R/3 system, for example...)
    Otherwise try to use a virtual cube !
    Hope it helps!
    Bye,
    Roberto

  • Multiple Value in additional fields using SAP Query

    HI All,
    I have a question related additional field in SAP Query. I tried to create report about PR and PO using SAP Query. Since one PR can be converted to multiple PO, I decided to create additional field
    po_1
    to display the value of PO that related to the PR. But I meet problem when I want to show several PO number in additional field
    po_1
    , I couldn't look the way to solve this problem. Can anybody help me? Just for info, I assign value to additional field
    po_1
    in record processing part.
    Thanks....

    HI,
    IN SQ02, IF table is already in JOIN, just click on the PLUS sign to expand the strcture.
    All the field showing Plus sign in the strcture are selected in your query and with MINUS sing are no selected.
    So you have to just click on the MINUS sign for the field you want to use through table field.
    Generate the query and execute thriugh SQ01.
    If you want to add some other field which is not a part of JOIN,
    then click on EXTRAS Button shown in the MENU option.
    Click on Create button and system will ask abt the additional field.
    Regds,
    Anil

Maybe you are looking for

  • SQL error with LIKE clause in statement

    Can anyone explain how an SQL statement with a LIKE clause is executed properly? Seems like it ought to be cut and dried, no pun intended! When I run the following and set the requestor name = ?, and correctly type in the entire name, a result set (a

  • NDES for MDM and BYOD

    Hi, I have to migrate windows 2003 CA setup to win 2012 set up. I have NDES installed on one of the Sub CA which will be used for Airwatch MDM integration. I have received new request for using NDES for BYOD configuration on CISCo ISE, pls refer to b

  • Why has EE vanished from my iPhone after updating to iOS8?

    Hello, I have an iPhone 4S and I am on a T-Mobile contract, EE has always been the network provider until I updated from iOS7 this morning to iOS8 and now T-Mobile is the provider, and the signal on 3G is naff! It's good on WiFi but I travel a lot an

  • Bapi_pr_create error

    Hi,      I am getting error 06                   243 Internal number assignment not defined (please enter number)                                   BAPI                 001 No instance of object type PurchaseRequisition has been created. External ref

  • Automatic Red Eye doesn't work

    I'm on Mac OS 10.6.8 and iPhoto 7.1.5.  Why doesn't the automatic red-eye edit work anymore?