Logical Column for calculation

Hi guru,
My requirement is we have to display report with Total count of Opportunities , Count new Oppty ( which are created with in 30days from today ) Count Old Opptys ( which are created more than 30days ago and Overdue ( which closed date is > current Date).
For this requirement I had created one logical column and I am getting error when ever I am using Timestampdiff.
Could you please let me know how can I create these 3 logical columns in Meta Data.
I am rally appreciate for your help.

Here is what you need to do:
1. Create a Session Variable in your RPD
2. Check the "Enable any user to set the value" checkbox in the Session Variable properties
3. In your dashboard prompt, select"Request Variable" in the Set Variable section
4. Enter the name of your Session Variable in the box that appears
5. Now you can reference the session variable in the formula of your logical column. Syntax: VALUEOF(NQ_SESSION.YOUR_SESSION_VARIABLE)
Note: You cannot reference Presentation Variables in the RPD
-Dave

Similar Messages

  • How To Create Logical column For Lastyear To Till Date

    Hi All,
    I Have to calculate Lastyear to Till Date for Logical Column.
    Ex:I have Time Dime and Fact column and Dimension columns.
    jan 2011 to oct 2012.
    Please Let me know.
    Thanks,
    Abhi

    Looks like you are not reading my messages
    Since you are doing on logical columns getting this error.
    Try this using physical columns then count from aggregate tab
    CASE WHEN "Oracle Data Warehouse"."Catalog"."dbo"."Fact_W_SRVREQ_F_Open_Date"."OPEN_DT_WID" > 20110101 THEN "Oracle Data Warehouse"."Catalog"."dbo"."Fact_W_SRVREQ_F_Open_Date"."SR_WID" END
    The same you can go with your variable
    Or else the same can do by duplicating the existing Fact - CRM - Service Request"."# of SRs" and just add above code.
    or just use the below you dont use sum since already aggregation is happend for # of SRs
    CASE WHEN "Core"."Dim - Date"."Year" = VALUEOf("Warehouse Refresh Date Last Year"."CURRENT_CALENDAR_YEAR_LAST_YEAR") AND "Core"."Dim - Date"."Date" < VALUEOF("Warehouse Refresh Date Last Year"."LAST_REFRESH_DATE_LAST_YEAR") THEN "Core"."Fact - CRM - Service Request"."# of SRs" END
    Hope this works, mark as correct

  • How to create logical columns for current period and prior period

    Hello all.
    Is there any way in obiee to create a new logica column in BMM layer that says "CURRENT PERIOD" AND "PRIOR PERIOD" OR ONE SINGLE COLUMN THAT SAYS "PERIOD".
    In those columns what I need is if it a current period column it shoould have 03/01/2012-03/31/2012 (this month date range)
    and in prior period column I shouldhave 02/01/2012 -02/29/2012(which is previous month date range).These columns I will be using in my reports.
    Please help me if we can create any such columns with these conditions/requirements

    Hi,I have already created he dynamic variables.But I am not getting how to use those variables and create the new logical columns in bmm layer.
    this is what I am trying
    case when VALUEOF("Current Month begin date"."Current Month begin date") ='..' and VALUEOF("Current Month end date"."Current Month end date")
    ='..' then 'current period' end
    I don't really understand what I should write case when VALUEOF("Current Month begin date"."Current Month begin date") ='..'??

  • MTD Logic Required for Calculation

    I have Month and year field in my DSO. Values Year(2009) and Month(4)
    I want below logic to calculate -
    MTD qty % = (qty * elapse days) / no of days in month
    so from the above, I want to know,
    1. How can we get the no of days from the above 2 objects (year and month).
    2. Elapse days are the days that are over from current date to Ist day of that month.
    eg: current date - 04.03.2009 , 1st day of the month - 04.01.2009,
    elapse days = 2. (you need to consider all days in the month, not only working days)
    so my questions is how can we get, # of days n a month from above 2 fields and elapse days based on the above condition.
    Also let me know, where in I need to put in my calculations at transformation level or at query level
    please provide your suggestions.
    Thanks,
    Pra

    Hi Pra,
    you can do this in both levels. But in this szenarion I would prefer a customer exit on query level. Otherwise you have to load data on daily basis.
    There are several function modules to implement this logic. Take a look at e.g. FIMA_DAYS_AND_MONTHS_AND_YEARS. This FM expects 2 import dates. You can fill in 2 dates like 1st day of month & last day of month. You can use this FM two times. First for calcualting all days of the month, second with last day sy-datum.
    I would use a calcualted key figure with formula variable of type customer exit. This variable will read the input date from an input ready date variable of type intervall based on 0CALMONTH.
    Regards
    Andreas

  • Logical column for sum number of occurences

    Hi,
    In Discoverer I have a column: "Number of Employees" and it is the expression like this: DECODE(Polisaid,Polisaid,1). I tried the same in OBI repository: CASE WHEN "Number of Employees" IS NOT NULL THEN 1 END. In query, How much employees are in HR Department The OBI gave me only number 1?? (I cannot use Aggregate function) while for the same query Discoverer gave me correct answer.
    How to solve the problem?
    Thanks in advance.

    Hi stanisa,
    DECODE(Polisaid,Polisaid,1)here decodeand case are same...he meant column equals polisaid then give me polisaid if not display 1.
    Case when "Number of Employees" is not null then "Number of Employees" else 1 end;
    Hope it helps you.
    By,
    KK

  • Logical Column(s) a.k.a. Pre-calculated Measures

    I am looking for best practices around logical columns either in Presentation Layer or Business Layer. Specifically I want to know..
    1) Is it advisable to have logical columns?
    2) How many are good to have? Should one create logical columns for all frequent calculations which are done on dashboards?
    3) Are there any performance implications?
    4) Can we use Time Series function with logical columns? Like AGO etc.
    In short I am looking for intelligent pros and cons of such implementations.
    PS: Logical columns are derived from physical columns. For e.g. Profit = Income - Expense.
    Regards.

    Hi
    1) all complex logic should be in the BMM layer in the RPD. Yes, it's advisable to have them in the BMM. Although another good practice is to try to delegate all complex calculations to ETL if possible.
    2) As many as deemed necessary. Yes.
    3) No, not really. But if you use Answers' logical columns - you have to be creative in propagating them to other reports.
    4) Yes you can. But again, this is something that's better to have in the RPD.

  • YTD Actual and Budget Formula in Logical column

    Hello,
    Im trying to replicate a report from Oracle EBS into OBIEE.
    I have to create logical columns for YTD Actual , YTD Budget,Current month actual, Current Month Budget using GL_BALANCES table. The formula currently im using is,
    YTD Actual:
    CASE WHEN GL_BALANCES.ACTUAL_FLAG = 'A' THEN (GL_BALANCES.PERIOD_NET_DR - GL_BALANCES.PERIOD_NET_CR)+ (GL_BALANCES.BEGIN_BALANCE_DR - GL_BALANCES.BEGIN_BALANCE_CR) ELSE 0 END
    YTD Budget :
    CASE WHEN .GL_BALANCES.ACTUAL_FLAG = 'B' THEN GL_BALANCES.PERIOD_NET_DR - .GL_BALANCES.PERIOD_NET_CR + (.GL_BALANCES.BEGIN_BALANCE_DR - GL_BALANCES.BEGIN_BALANCE_CR) ELSE 0 END
    Current Month actual :
    TODATE(GL_BALANCES."YTD Actual", "Time Dim"."Month")
    Current Month Budget :
    TODATE(GL_BALANCES."YTD Budget", "Time Dim"."Month")
    Please let me know, if my calculations are right.
    Thanks

    Hi,
    I have only one KF and after closing the month, I would load actuals to the Budget KF itself.
    Right now this coulmn is a formula with below:
    ( 1 <= 'Last Actual' ) * 'Jan / Actual' + ( 1 > 'Last Actual' ) * 'Jan / &0T_VERS&'
    And the column heading is "January Act/Budget"
    At the moment it is confusing for users to know which figures are Actuals and which are Budget.
    Thanks
    Priya

  • Changes to Derived Logical Column not reflected in Answers

    Before I go off my rocker and stab myself with my IPhone lightsabre... :-)
    I created a new logical column for an existing table in my BM, deriving from an existing column (a datetime field called ESTIMATEDCLOSE) as follows:
    MONTHNAME(Sales.OPPORTUNITY.ESTIMATEDCLOSE) || ' - ' || CAST(Year(Sales.OPPORTUNITY.ESTIMATEDCLOSE) AS CHAR(4))
    ...which should give me something like "Jan - 2008". The problem is that it returned something like "2008/01/31 00:00:00" in Answers - completely unexpected.
    I decided to start out small and try something simpler, changing my derived column to be only Sales.OPPORTUNITY.ESTIMATEDCLOSE. This returned "2008/01/31 00:00:00" in Answers - sort of expected.
    Then I changed it to MONTHNAME(Sales.OPPORTUNITY.ESTIMATEDCLOSE). This also returned "2008/01/31 00:00:00" in Answer!!!
    It almost seems as if a derived logical column is cached in some weird way and changes to the formula is not reflecting in answers. Thinking that something so simple must work and I made a simple mistake somewhere I have spend a good part of the past day playing around with this and trying every possible solution I can think of - no luck. The odd thing is that I would rename my logical column and this will be reflected in Answers, but changes to the derived expression is not reflected.
    - I deleted the column and started all over - no luck
    - tried creating derived columns using different datetime expressions or even just concatenating strings to each other - no luck.
    - Restarted all the Oracle services, thinking it's a cach'ing issue - no luck.
    - I rebooted the server - no luck.
    Once, when I started out with only MONTHNAME(Sales.OPPORTUNITY.ESTIMATEDCLOSE) I got back correct values in Answers (Jan, Feb, Mar..) and I thought the problem was finally gone. So I added || ' - ' || CAST(Year(Sales.OPPORTUNITY.ESTIMATEDCLOSE) AS CHAR(4)) to the derived formula. Guess what, Answers kept on giving me back only the Month names, completely ignoring my updated formula.
    Anybody else ran into this problem? Something so simple should surely work...

    John,
    Yes, cleared the cache (from Dashboard Administration) and also used nqcmd Call SAPurgeAllCache. Restarted BI Server. Still no luck.
    I tried your formula and then only got back "2008/01/31" (just the date without the timestamp) - very strange.
    Then I noticed the following amazing thing (by accident):
    I started with a request in Answers that does not contain my derived column and then add my derived column to the report. The text would be all wrong in this column (Jan, Feb, March). Then I add the same column again to the report and the second added column will magically show the correct strings (Jan - 2008) !!! Even stranger is that the moment I added the same column again to the report, the text on the first column would also magically jump to the correct values (Jan - 2008).
    I did a bit more testing and created a blank request and added my derived column as the only column - this time it will show the correct values immediately. It does seem like it's tied to the content already in the request. I went a step further and saved my buggy request and added it to a Dashboard - it worked perfectly in the Dashboard.
    Must be something buggy here in Answers when working with derived columns. I'm on 10.1.3.4...

  • Logical column not in hierarchy is shown as being drillable?

    I have a hierarchy created, lets say customer. Within all the levels, logical column "customer zipcode" is not added. By default then, this column would be associated with the detail or lowest level. When I create a report in answers with just this column, it shows up drillable whereby it drills to the lowest level which is apart of by default. So my question is why is this logical column drillable if it is not associated explicitly in the hierarchy?

    Thanks for the reply. Later yesterday I figured out the problem. It took some unit testing and trial and error; but, this is what I gathered during testing.
    1. logical columns for hierarchy table source that are not explicitly added to a level in the hierarchy is by default put in lowest level and they are not drillable because of that.
    2. If you add a logical column which is derived off other logical columns through an expression (for example concatenating col_nm||'('||col_cd||')' in the lowest level, add it as a key and set the key for "use for drilling" then this too will make all logical columns drillable to that. Don't know why but could be a bug.
    3. If you set preferred drill path for the lowest level to another hierarchy level, then those logical column(s) will be drillable. Probably because they are not at the lowest level any more since there is another level down now due to the preferred drill path.
    So in the end since the lowest level drillable column has to be a logical column which is built through expression and the fact that this lowest level needs to drill to another level in another hierarchy due to business requirements I am stuck with all columns not in the hierarchy being drillable. The fix around this though is to go to all these columns that are now drillable, set the aggregation rule to 'no interaction' and save as system-wide default.

  • Display values for logical columns with several physical sources

    Hi all,
    I'm enocuntering some strange behaviour with the values displayed for a column (when we want to add it a as a filter, and in the dialogue box select 'Show All' values).
    Basically the logical column is mapped against several physical columns as the base fact table is aggregated to different levels. Additionally, one column in the fact tables has an attribute value, and these vary between the aggregated and non-aggregated table. This is not a problem.
    In the production environment, when we display the all values in the filters prompt for this column we are seeing the values being taken from one fact table. Naturally this means that not all the values possible for this column are being shown (i.e. values from the aggregated fact tables are missing). Now in one of our test environment where those fact tabels have additional data loaded, the values are being taken from one of the other fact tables. Unfortunately it is not necessarily the fact table with less data.
    My questions are:
    a) What dictates which fact table the server will use when the query in Answers doesnt use any dimensions (i.e. we are selecting just this attribute and selecting all the possible values by which it can be filtered)?
    b) Is there a way of obtaining all the values from the differente physical columns? I.e. that the display values shows the values of that logical column across all the physical fact tables? Maybe we would need to model that attribute as a logical dimension just for that attribute? Im not really sure this would work, as at the physical level the join between the dimension and fact would still have to go to only one particular fact table.
    Any info or help is much appreciated.

    Hi,
    Aggregate tables exist at physical level and are created by ETL procedures. Although i am aware that the dimension come into play when the application needs to decide which source aggregate table to use, it is not an issue here as in our query we are not involving dimensions. We are selecting just this one columen, and then the filter option on this column, then in the dialogue box we select 'All Choices', only the values from one of the source tables is being shown.
    This is not a probelm within reports, i think it is a product limitation in that in that option to list all values a user can filter by, it is not possible to display all the values from the different fact tables to which that column is mapped.
    Has anyone else encountered this behaviour?

  • Aggregation tab disabled for fx logical columns

    Hello, I am new to OBIEE. Can somebody please help me understand the folowing -
    Query - While defining formula column in BMM whenver we use logical column as source why Aggregation Rule tab gets disable?
    How can i apply aggregation rule for such columns at RPD. These columns are recognised by icon fx.
    Please find attached screenshot to help understand my question.
    [https://picasaweb.google.com/105903262683032369187/OBIEE?authkey=Gv1sRgCPW2qu2x8eKdjgE]
    Any help is greatly appreciated.
    Thanks
    Edited by: 930542 on Jun 22, 2012 10:03 PM

    Click on LTS of Table - Column Mapping - Select the logical column - click on expression - Put your logic here. You will get Aggregation rule is enalbed for the column.
    Why ? -- Reason could be nested aggregation is not allowed. Aggregation on the normal column applied during query generation at run time. If you use that Agg.Measure to derive another Agg.measure server could not recognize it during runtime.

  • Design Table with no of columns used for calculating the total

    Hello,
    I need to design a table/s for calculating the column values based on the operators provided. Like I have a table say
    TableID, Col1 , Col2 ,Col3 ... Total Value
    Total Value Column is calculating Col1 (operator value provided by the user) Col 2 (operator value provided by the user) Col3 etc
    Although I m thinking to create another table which stores operator values, however not sure how to calculate the total.
    like it can be COl 1 +Col2 -Col3 %Col4 etc.
    Please help.

    Can you show some data example+ desired result?
    DECLARE @t TABLE(a INT,b INT,c INT);
    INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
    SELECT *
    ,      (   SELECT  COUNT(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS  CountVal 
    FROM @t;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • SAP logic for calculating the replenishment requirement - IS Retail

    Hi All,
              Could you explain from where does the RPLRQ field is getting picked up from the WRPT table.And what is the SAP logic for calculating the replenishment requirement for a particular article.
    Regards,
    PSS

    Dear PSS,
    Field RPLRQ represents for the replenishment requirement determined in the previous replenishment run. This can be changed when follow-on documents are created if order optimizing is active (for example, if quantities are to be rounded off).
    Bye,
    Muralidhara

  • Two physical logical source formulas for on logical column

    I have two fact tables :
    1. W_SERVICE_REQ_F(opened_dt_wid, assigned_dt_wid, closed_dt_wid, QUEUE_WID, SERVICE_REQ_WID): grain is one row per service request
    2. W_SERVICE_REQ_DAY_A(DATE_WID, QUEUE_WID, NUM_OPENED, NUM_CLOSED, num_assigned)
    The goal is to answer NUM_OPENED, NUM_CLOSED per queue in a day and be able to drill-down to those service requests.
    Physical model:
    Common_Date.row_wid = W_SERVICE_REQ_F (Opened_Dt).opened_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_F (Closed_Dt).closed_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_DAY_A.DATE_WID
    Queue_d.row_wid = W_SERVICE_REQ_F.QUEUE_WID
    Queue._drow_wid = W_SERVICE_REQ_DAY_A.QUEUE_WID
    Service_req_d.row_wid = W_SERVICE_REQ_F.SERVICE_REQ_WID. (there is no join between Queue_d and Service_req_d)
    BMM Fact and LTSs:
    I have W_SERVICE_REQ_DAY_A, W_SERVICE_REQ_F (Opened_Dt), W_SERVICE_REQ_F (Closed_Dt) as LTSs of "Fact - Service Request" in that order.
    BMM Fact logical columns (measures):
    # Closed
    # Opened
    Question:
    I want to configure each of the above logical column with two physical columns of different aggregate forumlas. (to ensure queries that dont need service req number hit a table) (similar to http://www.gerardnico.com/wiki/dat/obiee/fragmentationlevel_based).
    SUM(W_SERVICE_REQ_DAY_A.NUM_CLOSED)
    COUNT("W_SERVICE_REQ_F (Closed_Dt)".SERVICE_REQ_WID)
    Can someone help in configuring one logical column with two physical column sources with different aggregate formulas?
    This is what I tried:
    In # Opened Properites->Data Type, mapped it to both W_SERVICE_REQ_F (Closed_Dt).ROW_WID and W_SERVICE_REQ_DAY_A.NUM_CLOSED
    In # Opened Properties->Aggregation tab, selected 'Default aggregation rule' as Count Distinct. In the bottom, Logical table sources override as follows:
    W_SERVICE_REQ_DAY_A : SUM("Fact - Service Request"."# Closed")
    W_SERVICE_REQ_F : COUNT("Fact - Service Request"."# Closed")
    Should it be done in a different way?
    PS: OBIEE 10.1.3.4.
    added OBIEE version: Feb 3, 2012 4:40 PM

    I have two fact tables :
    1. W_SERVICE_REQ_F(opened_dt_wid, assigned_dt_wid, closed_dt_wid, QUEUE_WID, SERVICE_REQ_WID): grain is one row per service request
    2. W_SERVICE_REQ_DAY_A(DATE_WID, QUEUE_WID, NUM_OPENED, NUM_CLOSED, num_assigned)
    The goal is to answer NUM_OPENED, NUM_CLOSED per queue in a day and be able to drill-down to those service requests.
    Physical model:
    Common_Date.row_wid = W_SERVICE_REQ_F (Opened_Dt).opened_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_F (Closed_Dt).closed_dt_wid
    Common_Date.row_wid = W_SERVICE_REQ_DAY_A.DATE_WID
    Queue_d.row_wid = W_SERVICE_REQ_F.QUEUE_WID
    Queue._drow_wid = W_SERVICE_REQ_DAY_A.QUEUE_WID
    Service_req_d.row_wid = W_SERVICE_REQ_F.SERVICE_REQ_WID. (there is no join between Queue_d and Service_req_d)
    BMM Fact and LTSs:
    I have W_SERVICE_REQ_DAY_A, W_SERVICE_REQ_F (Opened_Dt), W_SERVICE_REQ_F (Closed_Dt) as LTSs of "Fact - Service Request" in that order.
    BMM Fact logical columns (measures):
    # Closed
    # Opened
    Question:
    I want to configure each of the above logical column with two physical columns of different aggregate forumlas. (to ensure queries that dont need service req number hit a table) (similar to http://www.gerardnico.com/wiki/dat/obiee/fragmentationlevel_based).
    SUM(W_SERVICE_REQ_DAY_A.NUM_CLOSED)
    COUNT("W_SERVICE_REQ_F (Closed_Dt)".SERVICE_REQ_WID)
    Can someone help in configuring one logical column with two physical column sources with different aggregate formulas?
    This is what I tried:
    In # Opened Properites->Data Type, mapped it to both W_SERVICE_REQ_F (Closed_Dt).ROW_WID and W_SERVICE_REQ_DAY_A.NUM_CLOSED
    In # Opened Properties->Aggregation tab, selected 'Default aggregation rule' as Count Distinct. In the bottom, Logical table sources override as follows:
    W_SERVICE_REQ_DAY_A : SUM("Fact - Service Request"."# Closed")
    W_SERVICE_REQ_F : COUNT("Fact - Service Request"."# Closed")
    Should it be done in a different way?
    PS: OBIEE 10.1.3.4.
    added OBIEE version: Feb 3, 2012 4:40 PM

  • BMM derived logical column - bounced visit

    In Web Metrics, a "bounced visit" is when a session views only one page on a website and then leaves. In my fact table, I capture the "total pages" viewed for each session and I define this metric in my Business Model with an aggregation rule of "sum". I'm trying to use this metric to derive the "bounced visit" metric but I'm running into issues.
    Session ID Total Pages
    1179860475     5
    1179861625     1 <= This is a bounced visit
    1179861920     7
    1179866260     2
    1179868693     13
    If I define "bounced visits" as
    CASE WHEN "total pages" = 1 THEN 1 ELSE 0 END
    What I see in the session logs is:
    CASE WHEN sum("total pages") = 1 THEN 1 ELSE 0 END
    The aggregation of the "total pages" is being done first and then the derived metric is being calculated. This leads to incorrect results. Is there anyway of solving this in the business model? I know that I can go back to the ETL, calculate a "bounce visit" metric, store it in the fact, build out aggregates, etc. I was looking for a short term solution.
    Other things I've tried:
    1) make a copy of the "total pages" column and turning off the aggregation, call it "total pages - no aggregation"
    this leads to queries of the form:
    select distinct T22583.TOTAL_PAGES as c1
    from
    WEB_SESSIONS_A1 T22583
    order by c1
    2) Create a logical column based on "total pages - no aggregation"
    bounced visit = CASE WHEN EnterpriseWarehouse."Web Sessions"."Total Pages - no aggregation" = 1 THEN 1 ELSE 0 END
    This leads to [nQSError: 14020] None of the fact tables are compatible with the query request Web Sessions.bounced visit.

    Cool. I now have two approaches to solve the problem. Thanks for your help. Using your technique, the new logical column shows up in the Logical Table Source screen and I can define an expression for that logical column. The second approach leaves the table type as a Physical table. This has some benefits as I've noticed that the queries that are generated when the table type is defined as a Select statement end up retrieving all of the columns, even though I only needed to act on one of them.

Maybe you are looking for