Date variable in a column formula

Hi
I am having trouble using date-values from a Dashboard Prompt in a column formula in Answers.
The situation:
I use a dashboard prompt to select a date, the selected date stored in a presentation variable ('production_end'). In an answers request, I would like to use the 'selected_date' value to filter values for one column:
FILTER("Measures new".Produced USING(Calender."Full Date" = @{production_end}{timestamp'2009-07-31 00:00:00'))
Error after prompt execution:
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <00>: Syntax error [nQSError: 26012] . (HY000)
SQL Issued: {call NQSGetQueryColumnInfo('SELECT FILTER("Measures new".Produced USING(Calender."Full Date" = 2010-07-14 00:00:00 FROM source_db')}
SQL Issued: SELECT FILTER("Measures new".Produced USING(Calender."Full Date" = 2010-07-14 00:00:00 FROM source_db
There is no problem using the production_end in a column filter to filter the whole request, the error only shows up whenever I try to use it in a column formula.
Hope you can help.
Thanks
Regards
Andy

Hi Kart,
I think I found the problem and the solution.
I use a dashboard prompt with a default value based on a repository variable ('today'). The prompt feeds a presentation variable ('prod_end').
In the answers request I use prod_end in the following column formula (I changed the request slightly compared to the ones we were discussing - the basic functionality of using the presentation variable is the same):
MONTH(timestamp'@{prod_end}')
That combination leads to the follow error when opening the dashboard for the first time:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000]
[nQSError: 10058] A general error has occurred.
[nQSError: 46047] Datetime value TIMESTAMP '2010-07-15 00:00:00' from TIMESTAMP '2010-07-15 00:00:00' does not match the specified format. (HY000)
The first timestamp probably being the timestamp defined in my column formula, the second one (the one selecting from) probably being the repository variable definition.
Solution:
If I default the dashboard prompt using an sql statement to refer to the repository variable 'today' it works
Default prompt to:
SELECT Calender."Full Date" FROM OLS where Calender."Full Date" = VALUEOF("today")
Thanks for your help
Regards
Andy

Similar Messages

  • How to declare a variable in Custom column formula?

    I'm adding a new column and I have a formula like it:
    if Text.Length(Text.Replace(Text.Replace([Text], "-", ""), " ", "") ) = 4
    then "CB0" & Text.Range(Text.Replace(Text.Replace([Text], "-", ""), " ", "") , 2)
    else Text.Replace(Text.Replace([Text], "-", ""), " ", "")
    i want to do something like it:
    string = Text.Replace(Text.Replace([Text], "-", ""), " ", "") ) 
    if Text.Length(string) = 4
    then "CB0" & Text.Range(string, 2)
    else string

    The issue you have is that you haven't output 'string' anywhere.  You can create a column with the manipulated text and then reference that column when applying the if statement.
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    String = Table.AddColumn(Source, "ReplacedText", each Text.Replace(Text.Replace([Text], "-", ""), " ", "")),
    AddColumn = Table.AddColumn(String, "EndResult", each if Text.Length([ReplacedText]) = 4
    then "CB0" & Text.Range([ReplacedText], 2)
    else [ReplacedText])
    in
        AddColumn

  • Presentation variable in column formula issue

    Hi,
    I'm having an issue about putting a presentation variable in a column formula. I'm using obiee 11.1.1.7.141014
    I'm adding a text in a formula column where I use two presentation variables: pPeriodo and pAno
    pPeriodo invoques the month selected in a prompt and pAno the year. I have to compare different years, so in one member I use @{pAno} when is the selected year and @{pAno-1} when is the prior year.
    The result of this (please see the header of the 2nd column):
    The problem is when Icompare to next years. So my issue happens when I do an addition to the presentation variable: @{pAno+1}
    It doesn't do the sum; it concatenates the value as you can see in the following images
    If anyone have a workaround about this, please share.
    Regards,
    Miguel

    Hi Joven
    Try @{pAno}+1 instead of @{pAno+1}
    Regards
    Rajagopal

  • Lookup column in calculated column formula

    I have a Lookup column(Discountfirst) which has Number.
    I also have another Calculated column(Finaldate) with Resulttype DateTime.
    One more column(DateofReceipt) in Date.
    My Calculated column formula looks like this
    =(DateofReceipt)+(Discountfirst).
    I get an error
    "One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas".
    I googled and came to know I can't use Lookup Column in Calculated field.
    Any suggestion how can do this ?

    This can't be done using calculated columns because calculated columns can only be used for columns on the same list.
    Using SharePoint Designer Workflows you can just use Create List Item and Update List Item actions so that whenever a user adds a value the item will be added in another list's column which contains the previous amounts already.
    http://stackoverflow.com/questions/16295567/how-to-create-calculated-column-with-data-from-another-list
    https://social.msdn.microsoft.com/forums/sharepoint/en-US/01989169-eac7-4f28-809d-6e5af400fb03/lookup-column-to-calculated-field-showing-string-at-beginning
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • How can you add data from a variable into a column in a data flow?

    I need to populate a table with data from a variable. The data type of the variable is String. I'm running into issues doing it the way I am. I have variable
    User:VariableName = "Some moderately sized string of data"
    When I try to use a Derived Column Transformation Editor to insert the variable into the data flow as a new column, SSIS forces the Data Type to be Unicode String[DT_WSTR] and I can't change it. Additionally the length is 0 and I also can't change that.
    When I run the package it errors with a truncation error. If the length is 0 then that makes sense but then why can't I change it to something that makes more sense?
    What is the correct way to go about this?

    Use advanced editor to change data type and length.
    http://www.sureshjoshi.com/development/ssis-string-variables-in-derived-columns/

  • Row and Column Formulas on a Data Form

    I am creating a data form which has both row and column formulas. I would like the row formulas to show for some of the cells but it seems to default to the column formula.
    How can I get my form to show the row formula result and not the column formula result?
    Thank you!

    Brian,
    See this example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:160
    There are also a coupleof others showing the same thing you want to achive.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Formula date variable ,which is processing by 'Customer exit' with ready in

    Hi ,
    I need to create 1 variable which takes date from user and do some calculation.irrespective of any date char.
    so I have created Formula date variable ,which is processing by 'Customer exit' with ready input .
    But when selection screen pop up date formula variable comes with the format yyyymmdd.
    but i need dd.mm.yyyy. i have checked my profile and it is dd.mm.yyyy.
    Waitin for reply

    Hi Babu
    Did you get the answer to the query....if yes please drop me a mail on this as I have the same requirement and thanks in advance...
    my id   [email protected]
    REgards
    Amit

  • How to display presentation variable in a column

    Hi all....I have to display presentation variable in a column...
    I tried placing @{variable_name} in column formula..
    But it is displaying a value 0 ..where the variable carries a date value.
    Any suggestions?

    Take a look at this blog: http://gerardnico.com/wiki/dat/obiee/presentation_variable
    Try it out by providing a default format.
    Thanks,
    BIPuser

  • Display table with variable number of columns

    Hello Forum,
    I'm trying to build an export view of User Management Engine data. I would like to output a table with one row for every user with yes / no fields indicating membership in each of the available groups. Because the number of available groups might change in the future, I can't hardcode the column names for the groups.
    That is, I call a webservice to compute a table, and I get back a table with a variable number of columns.
    When I try to insert the webservice into my VC model, it complains:
    "Port 'Response' was omitted because it includes nested tables, which are not presently supported by Visual Composer"
    You might be interested to know that the business method of my webservice (for testing purposes) looks as follows:
    public String[][] getVariableSizeArray() {
            String[][] ret = new String[10][];
            for (int i = 1; i <= 10; i++) {
                    ret<i> = new String[10];
                    for (int j = 1; j <= 10; j++) {
                            ret<i>[j] = Integer.toString(i * j);
            return ret;
    Any help is appreciated, and points will be awarded for helpful answers,
    Sincerely,
    Florian
    Message was edited by:
            Florian Something

    Hi Florian,
    dynamic data structures are not supported. You can do this with a workaround. If you know the maximum count of your columns then you can add them to the table and hide/unhide them dynamicly via a formula in the hidden condition. Of course in your WS you als need a fix structure of your columns.
    This is not the best solution, I know so far, but it works. This is just one limit of VC.
    Best Regards,
    Marcel

  • Dynamic Column Formula based on Prompt

    Hi,
    i've defined a prompt and a presentation variable associated called "Scenario". It can assume values "Actual" or "Budget"
    My Subject Area contains vary dimensions and a fact table called "Productivity Measures" with following fields: "Productivity Actual" - "Productivity Budget"
    I've created a report with an only field (Header: 'Productivity") which retrieves data from my "Productivity Measures" fact table.
    Now i want that if Scenario value is Actual, the column formula of my field is "Productivity Measures"."Productivity Actual", otherwhise if Scenario value is Budget, the column formula of my field change dinamically to "Productivity Measures"."Productivity Budget". Is it possible? How can i do?

    Hi user,
    Why cant you write a case statement on the column defined i.e. when you select actual you get what you want and viceversa
    eg:- CASE '@{scenario}'
    WHEN 'Actual' THEN 'Productivity Actual'
    WHEN 'Budget' THEN 'Productivity Budget'
    ELSE 'Productivity Actual'
    END
    In case of prompt_column you declared variable right,you can call it there or directly use column name.
    Hope it helps you with this.
    By,
    KK
    Edited by: Kranthi on Dec 16, 2010 11:21 PM

  • Assigning variable to a column value

    Hi,
    I am creating a report wherein I use a formula in one of the columns to forecast data. The values obtained in this column (as a result of application of the formula) is to be used to calculate the values for the second column.And the third column value is dependent on the second and so on....
    If I use the column formula directly,then many lines of coding are involved...Is it possible to store the value of a column in a variable and hence forth use it for manipulation in subsequent columns?

    Helios,
    I'm already having the same setup mentioned in the thread. And I'm doing exactly whats given there. But the issue seems to be something different. I'm assigning the value to the Global Variable in the Package through Apex. Here's the Package Code:
    CREATE OR REPLACE PACKAGE Schema1.SPMS_SECURITY_PKG
    AS
    X_app_user_id NUMBER DEFAULT -1;
    FUNCTION USER_ID RETURN NUMBER;
    END SPMS_SECURITY_PKG;
    CREATE OR REPLACE PACKAGE BODY Schema1.spms_security_pkg
    AS
    FUNCTION user_id
    RETURN NUMBER
    IS
    BEGIN
    -- RAISE_APPLICATION_ERROR(-20001,'USER ID'||'*'||X_app_user_id);
    RETURN NVL (x_app_user_id, -1);
    -- RETURN NVL (sys_context('USERENV', 'CURRENT_USER'), -1);
    EXCEPTION
    WHEN OTHERS
    THEN
    RETURN -1;
    END;
    And Here is the Trigger Code:
    CREATE OR REPLACE TRIGGER Schema1."USER_DETAILS_TRIGGER"
    BEFORE INSERT OR UPDATE
    ON PMS_SICAL.SPMS_USER_DETAILS REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF INSERTING
    THEN
    :NEW.created_by := spms_security_pkg.user_id;
    :NEW.created_date := SYSDATE;
    :NEW.START_DATE := SYSDATE;
    ELSIF UPDATING
    THEN
    :NEW.updated_by := SPMS_SECURITY_PKG.X_app_user_id;--spms_security_pkg.user_id;
    :NEW.updated_date := SYSDATE;
    END IF;
    END;
    But I always get -1 in the both in the table after the DMLs.

  • Error while passing prompt value in Column Formula

    Hi All,
    I have created a dashboard and added a dashboard prompt on that with a presentation variable named "promptdyn" that is basically showing bank names.
    Now i want to calculate the market value based on this prompt selection, so i edited the column formula as
    "WM FACT Sec"."MARKET VALUE" * EVALUATE('getBankBaseCurrencyValue(%2)' As Double,@{promptdyn},"Industry Type".INSTRUMENT_CCY)
    But it is throwing this error:
    \nQSError: 10058] A general error has occurred.
    \nQSError: 22051] The argument number 1 is not referenced in this evaluate expression: getBankBaseCurrencyValue(%2). (HY000)
    SQL Issued: SELECT "Industry Type".INDUSTRY_NAME, "Industry Type".INDUSTRY_TYPE, "WM FACT Sec"."MARKET VALUE" * EVALUATE('getBankBaseCurrencyValue(%2)' As Double,0,"Industry Type".INSTRUMENT_CCY) FROM WMAdHocReportingBMMSec
    I don't know what is wrong here.Here i tried to pass the value of the prompt to the function.
    Basically I have created a function in the database with two parameter as "bank name " and "Currency" and calling it with the help of evaluate function.
    How could we store the prompt value and pass it to some other function?
    Pls help me as it is urgent for me to solve.
    Thanks

    He Solved.
    Just i missed out to write %1,%2 in the evaluate function.
    But one thing i need to know that how can we store the value that is selected in a prompt say in dashboard prompt so that it can be used in query. Because i need to select a value first from the prompt and based on that i need to manipulate the values of the other request of the dashboard.
    Please Reply.
    Thanks

  • Check for null in column formula

    I have a quiz report in OBIEE BI, and I only want to show quizzes where the end date is not null.
    Is there a way to do that within the column formulas?
    Thanks

    Column filter select is not null

  • Performance issue due to column formula and filters

    Hi,
    I am facing strange issue with performance for my OBIEE reports. I have two sets of reports Static and Dynamic. Both runs against same tables. The only difference between these reports is that the Static reports would run against all the data for given aggregation level e.g. Year, Month, Date and so on. Where as for Dynamic one I have range prompts to filter data. Other difference is that I have a column formula for one of the column in the Dynamic report, which is nothing but Go URL to show another page with certain parameters.
    The static report takes around 14-15 Seconds where as the Dynamic one takes around 3.5 min. The amount of data and range is same here. From the logs I could see that for the Static reports, i.e. reports without filters it applys group by at SQL level where as it is not doing so for the dynamic one. Is this expected ?
    Second issue is, even if I say remove the filters and just have report with column formula in one and no formula in other there is significant time difference in the processing at Presentation service layer. Again this is taken from the log. it takes 8 second to get data from DB but shows almost 218 Seconds as response time at Presentation layer.
    Below are conceptual details about table and reports -
    Table 1 (It is date dimension) : Date_Dim
    DateCode Date
    Day Number
    MonthCode Varchar2
    YearCode Varchar2
    Table 2 (It is aggregate table at year level) : Year_Aggr
    DateCode Date (FK to Table1 above)
    Measure1
    Measure2
    Measure3
    Measure4
    Measure5
    Report 1
    Date_Dim.YearCode | Year_Aggr.Measure1 | Year_Aggr.Measure2 | Year_Aggr.Measure3 | Year_Aggr.Measure4
    Report 2
    Dashboard Filter : Dimension1 | Dimension2 | Year Start | Year End |
    Date_Dim.YearCode | Year_Aggr.Measure1 | Year_Aggr.Measure2 | Year_Aggr.Measure3 | Year_Aggr.Measure4
    Column formula for Date_Dim.YearCode is something like :
    '<a href="saw.dll?Dashboard&PortalPath=somepath and parameters  target=_self>'  || Date Dim"."YearCode" || '</a">'
    Filters :
    Dimension1 is prompted...
    Dimension2 is prompted...
    cast("Date Dim"."YearCode" as Int) is greater than or equal to @{Start_Year}
    cast("Date Dim"."YearCode" as Int) is greater than or equal to @{End_Year}
    Note : I need to apply cast to int as column is varchar2, legacy problem.+
    How can I fix this? Am I missing something? In the result of report2 the DB SQL doesn't show the year in where thought it is displayed in the logical sql.
    Let me know if anybody had faced this and have fixed. Or suggetion to make changes to fix this.
    Thannks,
    Ritesh</a>

    Hi Ritesh,
    I think you right about the root cause of your problem. The first request does the group by in the database which returns fewer records to the BI Server for processing. The second request does not do the group by and sends significantly more records back to the BI server forcing it to do the group by. Compound that with the fact that pivot table views are relatively expensive computationally and that explains the difference between the execution times.
    Assuming that the execution time of the first report is satisfactory, I would recommend you try to experiment with a few settings to see if you can get the second report to do the group by in the database.
    Are the two filters identical except for the following conditions?
    cast("Date Dim"."YearCode" as Int) is greater than or equal to @{Start_Year}
    cast("Date Dim"."YearCode" as Int) is greater than or equal to @{End_Year}
    Best regards,
    -Joe

  • 11.1.2 FR Column formula not working for rows other than first

    Hi All,
    I've a FR Grid with following layout
    Columns: Budget, Forecast, Var(Var being a formula col with the formula COL[A]- COL)
    Rows: Children of Total_Cost_Centre, Children of Total_Projects, ACC.10101
    Suppress MISSING on for row
    When i run the report, the rows show the valid combinations having data but the VAR column shows value only for the first combination while for rest of the rows it shows 0.
    The row selection is in one row only, not separate rows so there is no specific setting that could create the difference in results.
    Any help would be greatly appreciated.
    Cheers,
    Abhishek

    Hi All,
    I've a FR Grid with following layout
    Columns: Budget, Forecast, Var(Var being a formula col with the formula COL[A]-COL)
    Rows: Children of Total_Cost_Centre, Children of Total_Projects, ACC.10101
    Suppress MISSING on for row
    When i run the report, the rows show the valid combinations having data but the VAR column shows value only for the first combination while for rest of the rows it shows 0.
    The row selection is in one row only, not separate rows so there is no specific setting that could create the difference in results.
    Any help would be greatly appreciated.
    Cheers,
    Abhishek

Maybe you are looking for