Column Formula execution order
Hi all,
I have a simple rpt which a group with 3 field ( customer name, number , rev) and I have 4 CF to calc Tax (1), Frt(2), Cat(3), and Update a DFF(4) for the customer at that time....per line!
The order I want is 1,2,3,4 - the order the rpt is executing is 4,3,2,1....
My CF Update pops first which messes up my total rev.
Any ideas....
Thx
Danny,
I looked at the on-line help and it is not clear,
do you have any examples... srw.reference(????)
What do I do with this built-in function.... Since I have 4 CF - and want to have certain firing order..
I usually use srw.reference to before I calc something...
I am really not sure on this.
Thx
Similar Messages
-
I have several formulas and fields defined in the details section.
is there a document that describes the order in which formulas are executed, when placed in the details section ?
can i assume that if i want a specific formula to execute after all the others i have to add:
evaluateafter(formula #1);
evaluateafter(formula #2);
etc, etc for all other formulas
i have a formula that resets a few global variables used by the others(therefore has to execute last). all formuals are in the details section.
thanks in advance JohnHi John,
A Crystal Report executes in the left-to-right top-to-bottom fashion. So, formulas placed in higher sections execute 'early', again, depending upon whether they're 'whileprintingrecords', 'whilereadingrecords' or 'beforereadingrecords'.
If you wish to force formulas placed in the same section to follow an execution pattern i.e formula 1 after formula 2, formula 4 after formula 1..., then you're right, you would need to add 'evaluateafter (formula)'.
I'm not aware of any document that describes the order of formula execution, however you could still try searching in the Crystal help (F1).
Hope this helps!
-Abhilash -
Can I use to_date() function in Answers Criteria Column Formula
Hello.
A simplified example of what I'd like to achieve in a column formula -
year(to_date('1954-11-06', 'YYYY-MM-DD'))OBI tells me this is a syntax error.
Alternatively, I tried this -
year(cast('11/6/1954' as DATE))This gets past the syntax check, but results in "unhandled user-defined exception ORA-06512".
Any suggestions appreciated.
Thank you.
-csHere it is -
Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 6510, message: ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "APPS.APP_SESSION", line 313 at OCI call OCIStmtExecute: call /* 191215240 */ APP_SESSION.validate_icx_session('ScAGT-sNOLfHYfB6RveHGAiw:S') . [nQSError: 17011] SQL statement execution failed. (HY000)
SQL Issued: SELECT "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number saw_0, "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Item_Description saw_1, "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Creation_Date saw_2, "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Closed_Date saw_3, year(cast('11/6/1954' as DATE)) saw_4, case when (MONTH("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Creation_Date) < 8) and (MONTH("- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Order_Closed_Date) > 8) then 1 else 0 end saw_5 FROM "[Noetix-NoetixGlobalRepository] NoetixViews for Oracle Service" WHERE "- Nx_CSDG0_Repair_Orders (Depot Repair Views)".Repair_Number IN ('319317', '325405') ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5 -
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 -
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
AndyHi 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 -
Dashboard Prompt Execution Order
Hi everyone,
I wanted to create a few test cases to see which order the Dashboard prompts were executing. What I did was I created two identical dashboard prompts, DBP1 and DBP2, on column "Account Number". I set DBP1 to Default to Specific value of 1. I set DBP2 to Default to Specific value of 2. My assumption is that the last prompt that executes is the value that will be shown in a dashboard.
I put the two prompts into a Dashboard and ran a few tests and here is what I found out:
1. The order in which the prompts appear are the dashboard is irrelevant to the execution order.
2. The value to which the prompts are set to is irrelevant to the execution order
3. The name of the dashboard prompts is irrelevant to the execution order
4. The alias of the dashboard prmopt is irrelevant to the execution order
In my trials, the second dashboard prompt's value was always the one being shown. So I created a third dashboard prompt DBP3 set to value 3. Then all the prompts had 3 as their value. My conclusion is that DB prompts are executed in the order in which they are created. Some where in their metadata, there must be a sequence number or internal ID that grows each time a DB prompt is created. Then OBIEE uses this identifier to determine execution order.
Can anyone confirm or deny that?
Thanks!
-Joe
Edited by: Joe Bertram on Dec 5, 2009 10:44 AMHi Sunil,
Thanks for the reply. You are correct. Its seems that the dashboard prompts do execute asynchronously.
It turns out the reason why I was seeing newer dashboard prompts taking precendent over older dashboard prompts has to do with the cache. Apparently the last dashboard prompt in the cache, is the value all the prompts will have.
thanks!
-Joe -
Execution order - group by and order by
is there any execution order when we use group by and order by together in single query ?
BOL: "Logical Processing Order of the SELECT statement
The following steps show the logical processing order, or binding order, for a SELECT statement. This order determines when the objects defined in one step are made available to the clauses in subsequent steps. For example, if the query processor can bind to
(access) the tables or views defined in the FROM clause, these objects and their columns are made available to all subsequent steps. Conversely, because the SELECT clause is step 8, any column aliases or derived columns defined in that clause cannot be referenced
by preceding clauses. However, they can be referenced by subsequent clauses such as the ORDER BY clause. Note that the actual physical execution of the statement is determined by the query processor and the order may vary from this list.
1. FROM
2. ON
3. JOIN
4. WHERE
5. GROUP BY
6. WITH CUBE or WITH ROLLUP
7. HAVING
8. SELECT
9. DISTINCT
10. ORDER BY
11. TOP"
http://msdn.microsoft.com/en-us/library/ms189499.aspx
Kalman Toth Database & OLAP Architect
IPAD SELECT Query Video Tutorial 3.5 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
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.
ThanksHe 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?
ThanksColumn filter select is not null
-
Filter Function in Column Formula is not working properly
Hi,
I am using Filter Function in Column formula tab in Answers to calculate the Total sum from the start of the Fiscal month to the Month selected from the Prompt.
My requirement is I have total sales column. Now I need to calculate TYYTD kind of thing for which I cant use the Time sereis due to my report constraint.
Instead of that I am using this Filter function on TYYTD column where i am giving the filter as start of the Fiscal month to the month selected from the Prompt.
For example if I select May month from the Prompt then this TYYTD column should give me SUM(Total Sales) between Feb and May for which I am using the Filter Function. But it giving me only May sales whcih is same as Total Sales column.
Can anyone throw some light on this as this is very important for us or any alternate solution other than Time sereis measures.
Did anyone got this kind of issue with Filter Function?
Regards,
AzadOk...here's the steps to fix this as efficiently as possible. I have a whole bunch of mailboxes under "On My Mac" and they have a bunch of mailboxes nested in them. I get my messages into Apple Mail via IMAP. (I don't know if this matters.) The steps below assume you have a similar setup.
1. Hold the Option key down and click the dropdown arrow next to each mailbox that has one. This will cause all nested mailboxes below it to appear.
2. Go to the top of the list of mailboxes under "On My Mac" and highlight the first mailbox. Then hold the Shift key down and highlight the last mailbox in the list. This will cause all of the mailboxes and nested mailboxes to be highlighted.
3. From the menu, select "Mailbox --> Rebuild" and the rebuild process will start.
4. Watch the top of the mail screen to see the message count change as the mailboxes are being rebuilt. Wait until the activity stops before doing the next step.
5. As the mailboxes were rebuilt, many messages were reset as "Unread" even though every message was previously "Read." Make sure the mailboxes you want to affect are still highlighted. Right-click and select "Mark All Messages Read."
That fixed the problem for me. -
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,
MiguelHi Joven
Try @{pAno}+1 instead of @{pAno+1}
Regards
Rajagopal -
Passing filter values from column formula in OBIEE 10g
Hi,
I am trying to pass filter value from the column LY Spend YTD columns where we have a filter option and passing the year filter 2013 as below.
FILTER("Fact - Purchasing - Invoice"."LY Spend YTD" USING (Time."Year" = '2013'))
My goal behind doing this is, we have a filter already present for the whole criteria on the year which is 2012.
But specifically for this column i dont want to pass the year 2012 to it, Instead I want to pass 2013 to it. But I am not succeding the result is blank.
Please suggest and let me know if further understanding is needed.Hi Srini
Thanks for you reply.
I cannot do that way because some measures are satisfying with year 2012 and displaying the data and other measure are satisfying with 2013.
I am working on LY Spend YTD, LY spend YTD - 1, Spend YTD and Year ago spend.
So thats the reason I have thought that way of passing the filter in column formula irrespective of criteria filter.
Please suggest. -
Hi All,
I have to change the market value to a specific base currency. But i need to take the values from the FX_Rate table where we are storing current forex rates.
I have edited the column formula of Market_value as:
CASE "Currency".INSTRUMENT_CCY
WHEN 'INR' THEN ("Currency".MARKET_VALUE*0.025471) ELSE "Currency".MARKET_VALUE END
Then it works.
But when i am trying to provide the formula that is retrieving the value from the Fx_Rate then it throws error.
I have written a formula like this:
CASE "Currency".INSTRUMENT_CCY WHEN 'INR' THEN ("Currency".MARKET_VALUE*(SELECT "FX_RATE".RATE FROM "FX_RATE" WHERE "FX_RATE".CCY='INR' AND "FX_RATE".CCY2='USD' ))
ELSE "Currency".MARKET_VALUE END
ERROR:
\nQSError: 10058] A general error has occurred. \nQSError: 27002] Near <SELECT>: Syntax error \nQSError: 26012] . (HY000)
SQL Issued: SELECT CASE "Currency".INSTRUMENT_CCY WHEN 'INR' THEN ("Currency".MARKET_VALUE*(SELECT "FX_RATE".RATE FROM "FX_RATE" WHERE "FX_RATE".CCY='INR' AND "FX_RATE".CCY2='USD' )) ELSE "Currency".MARKET_VALUE END, Currency.INSTRUMENT_CCY, Currency.INSTRUMENT_ID, Currency.INSTRUMENT_TYP, Currency.MARKET_VALUE FROM CurrencyPL
Pls help me solve this problem. How can we use select statement in the column formula?
ThanksFirst option (OBIEE 10.1.3.3).
With EVALUATE funciton you can call user-defined functions directly from the database.
EVALUATE('MarketValueByBase(%1,%2)',Instrument_CCY, CCY2)
Check this thread by Venka:
http://oraclebizint.wordpress.com/2007/09/10/oracle-bi-ee-10133-support-for-native-database-functions-and-aggregates/
Another option (i think better !!!).
Add FX_RATE table to repository (physical and business model) -
How to display Columns in Alphabatical order when using DESC command
Hello
A table column is inserted not in alphabetic order during the table creation definition.
So while describing the table definition (e.g. desc emp)
it will not show in the same order as we are written during the table creation.
Question: is there any utility/command/query which will display the columns in alphabatical order while describing it.
Regards
Nikhil Waniselect column_name from user_tab_columns
order by column_name;
should do it.
Sunil -
Using a select clause in the column formula in an Analysis
Hi all,
Is there a function or syntax that I can use to simulate a "SELECT" clause in the column formula of an Analysis? What I am trying to achieve is displaying a measure from a specific fact record into the current record. For example, if the current record displays "Region","position", and "salary", I would like to add an additional column called "compared to" in which I can display the "salary" measure from another specific fact record whose attributes I know.
Is there a function/statement that I can use to achieve this?
ThanksHi,
U can't do it in Edit formula column..it's possible below one
Add SQL filter in that column then follow blow steps
Convert this filter to SQL
i.e : add more option to sql here u can write SQL query in that column
Thanks
Deva
Maybe you are looking for
-
Problems uploading a text file with line feed characters from Windows
Hi, I am using the FM GUI_UPLOAD to load a text file in which at the end of each line there is a line feed character. When I upload the file, the FM interprets the entire file as ONE record; it does not recognize the line feed character at the end of
-
Defining attribute for internal table within class builder?
Hello there, I use an function module that provides me an internal table which has the reference type of the DDIC object zml_output. Furthermore I call this function module within a global class that should keep the result of the function module into
-
I am using a pop3 provider which doesn't support any permanent flags. But I want to know what are the new messages. How do I do it?
-
Is anyone else experiencing Adobe Flash Player crashing while playing Facebook games?
Since updating Flash Player, it crashes often while I'm playing Zynga poker. My operating system is Windows 7, 64 -bit, Firefox my browser. Would like to know if there is something I can do to fix the problem.
-
Slow booting, Cannot install OS X Mavericks
Hello, i am having problems with my macbook pro mid 2010. The issue started when the computer was taking way too long to boot +15 min. When it finally did boot it was crawling slow. Literally the mouse cursor was lagging and everything took forever