Calculation Query
Some of our customers order single items and some order in cases. We have the master item list set up as 1 for the Items per sales unit and some other number for the Quantity for Packaging uom. This latter # can vary for different items.
I defined a field called U_Case_order in the RDR1 table that will allow the order taker to enter a case quantity. I then set up a Query as follows:
SELECT T0.SalPackUn * T1.U_Case_order AS 'Quantity' FROM dbo.OITM T0 INNER JOIN dbo.RDR1 T1 ON T1.ItemCode = T0.ItemCode AND T1.ItemCode = T0.ItemCode.
Finally, I defined a formatted search for the Quantity field using this query to refresh when I leave the U_Cae_order column. The result is blank with no error message.
Can anyone help?
You said that you use this query in a FMS on the Order document rows right? But in the query I don't see the use of B1 screen variables? The query is syntactically correct but since you don't use variables you are not pulling the data off the current document when the FMS runs. The query needs to be re-written with variables like this and placed on the QTY column.
SELECT SalPackUn * $[RDR1.U_Case_order.Numeric] FROM OITM WHERE ItemCode = $[$38.1.0]
the $[RDR1.U_Case_order bring in the value that the user enters into case column and the $[$38.1.0] gets replaced with the item code of the current line.
Dan
Edited by: Dan Love on Jan 10, 2008 11:14 AM
Edited by: Dan Love on Jan 10, 2008 11:16 AM
Similar Messages
-
Hello BW Experts,
how can we do a pre-calculated query? Not a pre-calculated web-template. Not broadcasting after the data is loaded into cube. Just, pre-calculated query. When the user clicks the query in bex. it should show the results immedietly..
Thanks,
BWerYour best way is to use cache. You can use the reporting agent background printing to act like you are going to print the query, but it will run it and if the users run the query for the same selection, they will receive the query that accesses the cache. You can also setup the variables to be changeable during navigation and if they are in the resultset, the users will be able to use cache. There is a document about this on BW Expert. Search the forum and there is a post with a link.
Thanks,
Jeff -
[code]
SQL> DESC MN_EMP_DEP_DET;
Name Null? Type
EMPID NUMBER(6)
NAME1_EN VARCHAR2(20)
NAME2_EN VARCHAR2(20)
NAME3_EN VARCHAR2(20)
NAME4_EN VARCHAR2(20)
NAME1_AR VARCHAR2(20)
NAME2_AR VARCHAR2(20)
NAME3_AR VARCHAR2(20)
NAME4_AR VARCHAR2(20)
ID_NO NUMBER(20)
RELATION VARCHAR2(20)
DOB DATE
NATIONALITY VARCHAR2(30)
OCCUPATION VARCHAR2(30)
RELIGION VARCHAR2(30)
ENTRY_PORT_NO VARCHAR2(40)
ENTRY_PORT_PL VARCHAR2(30)
CO_TKT NUMBER(1)
CO_EXT_REENTY NUMBER(1)
CO_MED NUMBER(1)
ID_ISU_FROM VARCHAR2(20)
VALID_FROM DATE
EXP_DATE DATE
DEP_ID NUMBER(7)
EFF_DATE DATE
ENT_PR_DATE DATE
SEQ_NO NUMBER(3)
REC_CRTN DATE
EF_STRT_FROM DATE
SQL> SELECT EFF_DATE FROM MN_EMP_DEP_DET WHERE EMPID=1657 AND CO_TKT=1;
EFF_DATE
01-06-2009
01-06-2009
SQL> SELECT MONTHS_BETWEEN(SYSDATE,EFF_DATE)/12 FROM MN_EMP_DEP_DET WHERE EMPID=1657 AND CO_TKT=1;
MONTHS_BETWEEN(SYSDATE,EFF_DATE)/12
4.0449144
4.0449144
SQL> SELECT (MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12 FROM DUAL;
(MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12
4.4615819
[/code]
when i calculate date in bulk Ex: table column name its given me the different result while when i calculate using below query is showing exact calculation how can i solve this problem using table column?
SQL> SELECT (MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12 FROM DUAL;
(MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12
4.4615819
I'm using forms 6i and database 9i.
Regards
MoazamMoazamShareef wrote:
SQL> SELECT EFF_DATE FROM MN_EMP_DEP_DET WHERE EMPID=1657 AND CO_TKT=1;
EFF_DATE
01-06-2009
01-06-2009
SQL> SELECT MONTHS_BETWEEN(SYSDATE,EFF_DATE)/12 FROM MN_EMP_DEP_DET WHERE EMPID=1657 AND CO_TKT=1;
MONTHS_BETWEEN(SYSDATE,EFF_DATE)/12
4.0449144
4.0449144
SQL> SELECT (MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12 FROM DUAL;
(MONTHS_BETWEEN(SYSDATE,'01/01/2009'))/12
4.4615819
[/code]
when i calculate date in bulk Ex: table column name its given me the different result while when i calculate using below query is showing exact calculation how can i solve this problem using table column?
First example you are doing months between: sysdate and 01-06-2009
Second case, you are doing months between: sysdate and 01-01-2009
Results appear correct and consistent.
try showing result of this query:
SELECT (MONTHS_BETWEEN(SYSDATE,to_date('01/06/2009','mm/dd/yyyy')))/12 FROM DUAL;
(I'm guessing at your date format, fyi ... ) -
Report Level Calculation query.
Hi Experts,
I have a query on one of my reports. I
had notification,task no in rows and three other key figures in columns
1)no of properties failed which will be at notificatn header level.
2)no of properties remedied whcih will be at notification item (i.e task level).
3) Outstanding properties.
Please find the sample output which i require for two notifications.
A has got 10 properties failed and 3 prop remedied in first task , 5 remedied in sec task , 1 remedied in third task.
So outstanding Prop key figure for A 2 task is No of properites failed - [ no of prop remedied first task + sec task].
Nftn Task No (No of Prop Failed) (No of Prop Remedied ) (Outstanding Prop )
A 1 10 3 7 10-3
2 10 5 2 10 u2013 (3+5)
3 10 1 1 10-(351)
[Result ] 10 9 1
B 1 5 1 4 5 - 1
2 5 2 2 5 - (1+2)
3 5 0 2 5 - (120)
[Result ] 5 3 2
[Overall Result ] 15 12 3
I could attain the output as below which is little ok but not 100% complete output they requrie.
I could not get overall result as 15 for No of Prop Failed because single results make average to get 10 instead of 30.
So single results 10 and 5 average comes to 7.5. How can we make one result row to act like one condiotn and another outmost result row to other condition.
How to obtain the outstanding column populated above. What i made is i made sumct(no of prop remedied) so i got 9 for A and 3 for B and then subtracted 10 - 9 across all tasks which is little ok but not absolutely correct.
Nftn Task No (No of Prop Failed) (No of Prop Remedied ) (Outstanding Prop )
A 1 10 3 1 10-9
2 10 5 1 10 -9
3 10 1 1 10-9
[Result ] 10 9 1
B 1 5 1 2 5 - 3
2 5 2 2 5 - 3
3 5 0 2 5 - 3
[Result] 5 3 2
[Overall Result] 7.5 12 XX
can any one share some thoughts on this one.
Thanks
Vamsi
Edited by: vamsi talluri on Nov 8, 2010 6:51 PMHi,
first of all you should not leverage the InfoProvider directly but instead use the BEx Query and this type of prompting could then be done as an EXIT variable in the BEx query.
ingo -
Hi All,
Can anybody provide me the query to calculate datalag between primary and standby databases for oracle 11gr2.
I'm using the below queries with which i'm getting negative value(i.e. standby database is ahead of primary database).
1) ON DR (For Max Sequence : DRLogSequence )
select max(sequence#) from v$log_history where
(select min(checkpoint_change#) from v$datafile_header where file# in
(select file# from (select file#, enabled from v$datafile where status = 'ONLINE')
where enabled = 'READ WRITE')) between first_change# and next_change#;
2) ON Production (For Time stamp of DR Log )
select sequence#,to_char(COMPLETION_TIME,'mm-dd-yyyy hh24:mi:ss') completion_time,to_char(first_Change#)
first_change# from gv$archived_log where sequence#=<sequence# output of query 1> and rownum<2;
3) ON Production (For Time stamp of PR Log )
select sequence#,to_char(COMPLETION_TIME,'mm-dd-yyyy hh24:mi:ss') completion_time,to_char(first_Change#) first_change# from v$archived_log
where (select min(checkpoint_change#)
from v$datafile_header where file# in
(select file# from (select file#, enabled from v$datafile where status = 'ONLINE')
where enabled = 'READ WRITE')) between first_change# and next_change# and rownum<2;
how can i get the positive value, where i can see primary is always ahead of standby.
Thanks in advance....!!Why not just compare "Applied_Time" by DEST_ID ?
SELECT
TO_CHAR(MAX(COMPLETION_TIME),'DD-MON/HH24:MI') APPLIED_TIME
FROM
V$ARCHIVED_LOG
WHERE
DEST_ID=2
AND
APPLIED='YES'
Best Regards
mseberg -
ADF Faces : simultaneous partial page rendering
hi
I'm wondering what I can expect from "simultaneous partial page rendering".
I would like to have some af:selectOneChoice components on a page, with next to them some related information about the selected value.
This example application, created using JDeveloper 10.1.3.3.0, does this using partial page rendering (check README.txt):
http://verveja.footsteps.be/~verveja/files/oracle/SimultaneousPPRApp-v0.01.zip
It as a pprPage.jspx with these components ...
<af:panelPage title="pprPage">
<af:panelHorizontal>
<af:commandButton text="some button"/>
<af:objectSpacer width="10" height="10"/>
<af:outputText value="requestCounter.value = #{requestCounter.value}"/>
</af:panelHorizontal>
<af:panelHorizontal>
<af:selectOneChoice label="selectOneChoice A"
id="selectOneChoiceA" autoSubmit="true"
binding="#{backing_PPRPage.selectOneChoiceA}"
valueChangeListener="#{backing_PPRPage.onChangeSelectOneChoiceA}">
<af:selectItem label="null value label"
value="#{null}"/>
<af:selectItem label="first choice label"
value="first-choice-value"/>
<af:selectItem label="second choice label"
value="second-choice-value"/>
<af:selectItem label="third choice label"
value="third-choice-value"/>
</af:selectOneChoice>
<af:objectSpacer width="10" height="10"/>
<af:outputText value="#{backing_PPRPage.selectOneChoiceARelatedValue}"
partialTriggers="selectOneChoiceA"/>
</af:panelHorizontal>
<af:panelHorizontal>
<af:selectOneChoice label="selectOneChoice B"
id="selectOneChoiceB" autoSubmit="true"
binding="#{backing_PPRPage.selectOneChoiceB}"
valueChangeListener="#{backing_PPRPage.onChangeSelectOneChoiceB}">
<af:selectItem label="null value label"
value="#{null}"/>
<af:selectItem label="fourth choice label"
value="fourth-choice-value"/>
<af:selectItem label="fifth choice label"
value="fifth-choice-value"/>
<af:selectItem label="sixth choice label"
value="sixth-choice-value"/>
</af:selectOneChoice>
<af:objectSpacer width="10" height="10"/>
<af:outputText value="#{backing_PPRPage.selectOneChoiceBRelatedValue}"
partialTriggers="selectOneChoiceB"/>
</af:panelHorizontal>
<af:outputText value="userAgentHelper.info = #{userAgentHelper.info}"/>
</af:panelPage>... and has a backing bean like this ...
public class PPRPage
public String getSelectOneChoiceBRelatedValue()
return "some " + fSelectOneChoiceB.getValue() + " related value"
+ ", requestCounter.value = " + ELHelper.get("#{requestCounter.value}");
public String getSelectOneChoiceARelatedValue()
return "some " + fSelectOneChoiceA.getValue() + " related value"
+ ", requestCounter.value = " + ELHelper.get("#{requestCounter.value}");
public void onChangeSelectOneChoiceA(ValueChangeEvent pValueChangeEvent)
// simulating a slow operation/response
try
Thread.sleep(2000);
catch (InterruptedException ex)
; // ignore;
public void onChangeSelectOneChoiceB(ValueChangeEvent pValueChangeEvent)
// nothing here to slow things down
}It is important to note that changing the value for the "selectOneChoice A" dropbox has some time consuming operation to perform (possibly calculating/querying the related information to show next to it).
Using IE 6 ("userAgentHelper.info = ... MSIE 6.0 ..."), this behaves like this:
(ie-1) Run pprPage.jspx in JDeveloper, which results in a page that shows this:
selectOneChoice A [null value label] some null related value, ...
selectOneChoice B [null value label] some null related value, ...(ie-2) Select "first choice label" from the "selectOneChoice A" dropbox and immediatly after that select "fourth choice label" from the "selectOneChoice B" dropbox, which results in a page that shows this:
selectOneChoice A [first choice label] some first-choice-value related value, ...
selectOneChoice B [fourth choice label] some null related value, ...(ie-3) Select "second choice label" from the "selectOneChoice A" dropbox, which results in a page that shows this:
selectOneChoice A [second choice label] some second-choice-value related value, ...
selectOneChoice B [fourth choice label] some fourth-choice-value related value, ...Using Firefox 2.0 ("userAgentHelper.info = ... Firefox/2.0.0.12"), this behaves like this:
(ff-1) Do the same as in step (ie-1), which has the same result as step (ie-1).
(ff-2) Do the same as in step (ie-2), which results in a page that shows this:
selectOneChoice A [first choice label] some first-choice-value related value, ...
selectOneChoice B [fourth choice label] some fourth-choice-value related value, ...
questions:
(q1) Why does the related information, for the selected "fourth choice label", not show up in step (ie-2) (as it does in step (ff-2))?
(q2) Why does the related information, for the selected "fourth choice label", show up in step (ie-3) while the value was only/already changed in step (ie-2)?
(q3) Does some general approach exist to prevent "simultaneous partial page rendering" behaviour as described in (q1) and (q2)?
many thanks
Jan Verveckenrepost
-- -
Discoverer 3.1.42 User Edition Bug? EUL Corruption?
We have applied the 3.1.42 patchset but are experiencing some serious buggy behaviour.
The worst problem appears in User Edition if a Parameter is used in a Calculation and there are also Totals on one or more columns. When first created, this situation may work for a while, but further manipulations usually cause the query to crash with a message like: "Internal EUL error: EULParseNodeType error in canonical formula" (apologies: I don't have the exact message in front of me here). Once that error occurs, it seems to always occur in that Worksheet when a Calculation involves a Parameter AND there is a Total declared.
Is this a known bug? Has anyone else run across this? Does the Worksheet get corrupted in the EUL?
This one problem (oh, there are several others) is causing some significant grief.
Help is appreciated.
nullI haven't seen what you are mentioning yet. However, if you create a calculation or parameter in 3.142 and one of your users still has 3.141, the user will get an error message: Invalid combination of filters or calculations, query cannot be resolved. Upgrading to 3.142 corrects this for the user.
-
Blue screen with Discoverer 3.1 End-User
I have a workbook with four worksheets. With one of the worksheets (the other three seem fine) I get a blue screen on my workstation when trying to export the workbook to MS EXCEL. The worksheet in question has approx. 20,000 rows. I have export other worksheets that had over 50,000 rows without an issue. It seems, that when this worksheet exports, it suck all resources for my workstation.
Looking for helpI haven't seen what you are mentioning yet. However, if you create a calculation or parameter in 3.142 and one of your users still has 3.141, the user will get an error message: Invalid combination of filters or calculations, query cannot be resolved. Upgrading to 3.142 corrects this for the user.
-
Difference between aggregation and calculation tab in BEx Query Designer
HI,
I am using BEx Query Designer for my report, for the key figures in the coloumn area i slected one numeric key figures, in the properties tab i found aggregation tab and calculation tab.
I need to sum up the total values for that particualar coloumn, when i used calculation tab i found to sum all the values for a particular coloumn, then what is the use the aggreagation tab?
I not able to used that Aggregation tab it is showing as a hidden fields...
can any one tell me whats the exact difference between these tabs and when we need to use which tab?
With Regards,
Thanesh Kumar.Hi Thanesh Kumar,
I moved this thread from forum Data Warehousing to Business Explorer since it is a query related question (as SDN moderator).
I could explain to you the difference between these two tabs.
For "calculation" tab, it changes the display of result and does not change the calculation logic.
It means that, if this key figure is used further in formula, still the original number (without "calculation" tab setting) is used for further formula calculation.
For "aggregation" tab, it changes the real calculation logic.
The system takes the setting as the aggregation rule for records.
The most common aggregation rule is of course summation. If you set to e.g. Average here, the system does the
Average instead of summation when aggregating records. And the Average value will be taken for calculation
in further formulas or other calculations.
For "aggregation" tab, you could only use it for CKF (calculated key figure) or formula and you could not use it for
a basic key figure. That should be the reason why you see it greyed-out.
Regards,
Patricia -
Help with query calculations (recursive)
Hi All,
I want some help with a query using a base rate and the result use in the next calculation year.
Here an example:
create table rate_type(
rate_type_id number,
rate_desc nvarchar2(50),
rate_base_year number
insert into rate_type(rate_type_id, rate_desc, rate_base_year) values (1, 'Desc1', 4.6590);
insert into rate_type(rate_type_id, rate_desc, rate_base_year) values (2, 'Desc2', 4.6590);
create table rates (
rate_type_id number
rate_year number,
rate_value number
insert into rates(rate_type_id, rate_year, rate_value) values (1, 2012, 1.2);
insert into rates(rate_type_id, rate_year, rate_value) values (1, 2013, 1.3);
insert into rates(rate_type_id, rate_year, rate_value) values (1, 2014, 1.4);
insert into rates(rate_type_id, rate_year, rate_value) values (2, 2012, 1.2);
insert into rates(rate_type_id, rate_year, rate_value) values (2, 2013, 1.3);
insert into rates(rate_type_id, rate_year, rate_value) values (2, 2014, 1.4);The calculation for the first year should be the base rate of the rate type. The next year should use the result of the previous year and so on.
The result of my sample data is:
2012 = 4.659 + 1.2 + 4.659 * (1.2 * 0.01) = 5.9149
2013 = 5.9149 + 1.3 + 5.9149 * (1.3 * 0.01) = 7.1859
2014 = 7.1859 + 1.4 + 7.1859 * (1.4 * 0.01) = 8.4721Query result:
NAME 2012 2013 2014
Desc1 5.9149 7.1859 8.4721
Desc2 XXXX XXX XXXX
How can I do this in one select statement? Any ideas?
Thanks!Assuming you are on 11.2:
with t as (
select a.rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
count(*) over(partition by a.rate_type_id) cnt,
row_number() over(partition by a.rate_type_id order by rate_year) rn
from rate_type a,
rates b
where a.rate_type_id = b.rate_type_id
r(
rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
cnt,
rn,
result
) as (
select rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
cnt,
rn,
rate_base_year + rate_value + rate_base_year * rate_value * 0.01 result
from t
where rn = 1
union all
select t.rate_type_id,
t.rate_desc,
t.rate_year,
t.rate_base_year,
t.rate_value,
t.cnt,
t.rn,
r.result + t.rate_value + r.result * t.rate_value * 0.01 result
from r,
t
where t.rate_type_id = r.rate_type_id
and t.rn = r.rn + 1
select *
from (
select rate_desc name,
rate_year,
result
from r
where rn <= cnt
pivot (sum(result) for rate_year in (2012,2013,2014))
order by name
NAME 2012 2013 2014
Desc1 5.914908 7.2918018 8.79388703
Desc2 5.914908 7.2918018 8.79388703
SQL> Obviously pivoting assumes you know rate_year values upfront. If not, then without pivoting:
with t as (
select a.rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
count(*) over(partition by a.rate_type_id) cnt,
row_number() over(partition by a.rate_type_id order by rate_year) rn
from rate_type a,
rates b
where a.rate_type_id = b.rate_type_id
r(
rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
cnt,
rn,
result
) as (
select rate_type_id,
rate_desc,
rate_year,
rate_base_year,
rate_value,
cnt,
rn,
rate_base_year + rate_value + rate_base_year * rate_value * 0.01 result
from t
where rn = 1
union all
select t.rate_type_id,
t.rate_desc,
t.rate_year,
t.rate_base_year,
t.rate_value,
t.cnt,
t.rn,
r.result + t.rate_value + r.result * t.rate_value * 0.01 result
from r,
t
where t.rate_type_id = r.rate_type_id
and t.rn = r.rn + 1
select rate_desc name,
rate_year,
result
from r
where rn <= cnt
order by name,
rate_year
NAME RATE_YEAR RESULT
Desc1 2012 5.914908
Desc1 2013 7.2918018
Desc1 2014 8.79388703
Desc2 2012 5.914908
Desc2 2013 7.2918018
Desc2 2014 8.79388703
6 rows selected.
SQL> SY. -
Key Figure Calculation in Query
Gurus,
How do i calcculate below in query basically i have 3 KF as dates below and want a CKF or formula variable
which calculates A - (IF B Not Empty then take B or else take C.)
Z = A - if (B != " '', B, C)
A = Key Figure
B = Key Figure
C = Key Figure
thanksHI Zuben,
To acheive this
calculates A - (IF B Not Empty then take B or else take C.)
Z = A - if (B != " '', B, C)
A = Key Figure
B = Key Figure
C = Key Figure
Try this !!!!!!!
If u create a CKF,u will have operators in it,in that choose Boolean Operators,again in that chose
1)is not equal to
and
2)Equal to.
for ur calculations.
Z= Calculated Key Figure.
Z= A - (B NE 0)B + ( B EQ 0)C
Case One -- B NE 0
Z= A-(1 * B)+0
Z = A-B
Case Two -- B EQ 0
Z= A-(0 * B)+(1*C)
Z = A-C
I guess this is your requirement.
Rgds
SVU -
InfoSet query - eliminate duplicates while calculating amounts
I got InfoSet consist of FI DSO and Dunning data DSO.
FI fields in Infoset are:
AC_DOC_NUM
LINE_ITEM
AMOUNT
Dunn. fields in InfoSet are:
AC_DOC_NUM
LINE_ITEM
DUNN_NUM
DUNN_AMOUNT
ODS are joined through AC_DOC_NUM + LINE_ITEM fields.
Every combination of FI (ac_doc_num+line_item) can have several dunn_num, and as a result I get wrong (larger) amounts in InfoSet while summing up on ac_doc_num level.
Is there any possibility to get valid FI amounts on Query level?Hello Mr.Gediminas Berzanskis,
I am Narendra, searching for the solution for the same issue. found that you got a solution for the issue.
Here i am connecting 3 DSO's from Sales. Here I need to have the data for a scheduling aggrement where there is a shipping done in a month, the problem is that I am getting the data for all the schesduling aggrements which were happend once in a month, if for the same aggrement number if there 2 or 3 days then i am getting the average of all
example:Data in DSO level
Scheduling no. Date Value
1200000001 24.10.2009 20
1200000001 27.10.2009 10
1200000045 29.10.2009 50
1200000128 03.10.2009 40
for the above i am getting the duplicate records i.e. same value getting repeted for "n" times then i am calculating the values in reporting by dividing the value with row count. i am able to get the correct value, but if the case of above getting the average
Data in Infoset level
Scheduling no: 1200000001
Infoset values 202020202010101010+10 = 150
in report i am calculting like this 150/10 = 15
where as the exact value for the above is 30
Scheduling no:1200000045
Infoset values 5050505050 = 250
in report i am calculting like this 250/5 = 50 which is correct
Scheduling no:1200000128
Infoset values 4040404040 = 200
in report i am calculting like this 200/5 = 40 which is correct
Requesting you to help me over this, that will be very kind of you.
Thanks in advance
Narendra -
Is there a way to consolidate calculations used in SQL Query Data Sets?
I am building SQL Query Data Sets against multiple DB Views which all have different date formats. I have the date parameter working well, but want to consolidate the changes that I have to do to it especially for the quarter. For example the SQL against a monthly view would use "where year_month > to_char(:ST_DATE, 'YYYY-MM')" which is not too hard, but to make that work for the quarterly view I need several concats and a decode to get a "> '2012-Q2'". I would like not to have to do this within every where clause. I had put this into a global element hoping to use that in a filter for the data set, but the filter does not have access to global elements only parameters.
Is there any way to refer to a calculated global element from the data set to do this? I am using Layout Templates, so even if I wanted to I could not do the condition within the template.
Thanks,
RickChange the following line to include the red coloured parts
<div class="MasterColumn" spry:repeat="ds4" spry:setrow="ds4" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">
<span>{Dsp_#}</span><span>{Dsp_WkDay}</span><span>{Dsp_Event}</span>
</div>
The add the following style rule to your document:
.MasterColumn span {
display: inline-block;
I hope this helps.
Ben -
Update column using a calculation based on a query
Hi,
I need to update an empty column I have created in my table. I have created a query that returns the variables I will need in the calculation but I'm not sure how to link it.
This query works fine.
Select z.seq_no
, z.Day_X
, z.Day_Y
, x.Night_X
, x.Night_Y
from
(select seq_no, ga.centre_x Day_X, ga.centre_y Day_Y
from MICHAELC_Nov_01_final ff, rbn_gis_area ga
where ff.day_addr_code = ga.sp_code) z
,(select seq_no, ga.centre_x Night_X, ga.centre_y Night_Y
from MICHAELC_Nov_01_final ff, rbn_gis_area ga
where ff.risk_addr_code = ga.sp_code) x
where z.seq_no = x.seq_noWhat I require is my column called Distance_to_work to be calculated as follows:
Distance_to_work = (100 * sqrt (power ( (Day_X - Night_X), 2) + power ( (Day_Y - Night_Y), 2)))This is what I have tried to no avail:
UPDATE MICHAELC_Nov_01_final ff
SET
Distance_to_work = (select (100 * sqrt (power ( (Day_X - Night_X), 2) + power ( (Day_Y - Night_Y), 2))))
from
(Select z.seq_no
, z.Day_X
, z.Day_Y
, x.Night_X
, x.Night_Y
from
(select seq_no, ga.centre_x Day_X, ga.centre_y Day_Y
from MICHAELC_Nov_01_final ff, rbn_gis_area ga
where ff.day_addr_code = ga.sp_code) z
,(select seq_no, ga.centre_x Night_X, ga.centre_y Night_Y
from MICHAELC_Nov_01_final ff, rbn_gis_area ga
where ff.risk_addr_code = ga.sp_code) x
where z.seq_no = x.seq_no) w
where ff.sp_code = w.sp_codeAny assistance would be appreciated.
Banner:
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
"CORE 11.2.0.2.0 Production"
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionHi,
885178 wrote:
... with Temp_table
as
select 77317027 sp_code, 28.137 x_day, 28.244 x_night, -26.179 y_day, -26.092 y_night, 13.7905 distance_to_work from dual
union all
select 57218000 sp_code, 30.897 x_day, 30.851 x_night, -30.022 y_day, -29.884 y_night, 14.54647 distance_to_work from dual
union all
select 70406009 sp_code, 28.131 x_day, 28.192 x_night, -26.316 y_day, -25.837 y_night, 48.28685 distance_to_work from dual
select *
from Temp_table
What is temp_table? What role does it play in this problem?
with michaelc_nov_01_final2
as
select 77317027 sp_code, 77317029 risk_addr_code, 77303000 day_addr_code, 1274799 seq_no, 13.7905 distance_to_work from dual
union all
select 57218000 sp_code, 57271032 risk_addr_code, 57218000 day_addr_code, 1624223 seq_no, 14.54647 distance_to_work from dual
union all
select 70406009 sp_code, 77603008 risk_addr_code, 77301006 day_addr_code, 2240402 seq_no, 48.28685 distance_to_work from dual
select *
from michaelc_nov_01_final2What is micahealc_nov_01_final2? Do you want micahealc_nov_01_final to be changed so that it is just like micahealc_nov_01_final2? Can't you just post the results you want, like this:
` SP_CODE RISK_ADDR_CODE DAY_ADDR_CODE SEQ_NO DISTANCE_TO_WORK
77317027 77317029 77303000 1274799 13.7905765
57218000 57271032 57218000 1624223 14.5464772
70406009 77603008 77301006 2240402 48.2868512?
The data above is what michaelc_nov_01_final looks like after running the MERGE statement below. Distance_to_work isn't exactly what it is in michaelc_nov_01_finalw, but it looks like you're just rounding differently.
The rbn_gis_area is versioned. There is a column called version and the latest version = 10. This will bring back unique rows. There's no version column in the code above.
with rbn_gis_area
as
select 77303000 sp_code, 28.137 centre_x, -26.179 centre_y from dual
union all ...
Also note that an sp_code can be day_addr_code as seen in the above example. Seq no. is not unique. There is a column in michaelc_nov_01_final called cla_case which is unique.There's no cla_case column in the code above.
with michaelc_nov_01_final
as
select 77317027 sp_code, 77317029 risk_addr_code, 77303000 day_addr_code, 1274799 seq_no, '' distance_to_work from dual
union all ...The following assumes that seq_no is unique:
MERGE INTO michaelc_nov_01_final dst
USING (
SELECT ff.seq_no
, MIN (d.centre_x) AS day_x
, MIN (d.centre_y) AS day_y
, MIN (n.centre_x) AS night_x
, MIN (n.centre_y) AS night_y
FROM michaelc_nov_01_final ff
JOIN rbn_gis_area d ON ff.day_addr_code = d.sp_code
JOIN rbn_gis_area n ON ff.risk_addr_code = n.sp_code
GROUP BY ff.seq_no
) src
ON (src.seq_no = dst.seq_no)
WHEN MATCHED THEN
UPDATE SET dst.distance_to_work = 100 * SQRT ( POWER (src.day_x - src.night_x, 2)
+ POWER (src.day_y - src.night_y, 2)
;If cla_case unique in your real table, then use cla_case instead of seq_no above.
I used GROUP BY TO get (at most) one row in src for every row in dst. If you have a version column, you can use that instead or GROUP BY, just make sure that each row in src matches (at most) one row in dst. -
Calculated Key Figures Corrupted in a BEX Query
Hello SDN's,
We are facing an weird issue in BEX Query. As part of Enhancing the query, We have created a new CKF and added in the Columns for the required CKF. It prompted for a Transport request and saved the Query elements for more than hour. Now the Query is throwing an Error messages where in more than some 30 CKF's got corrupted. When i check the CKF definition for all the corrupted key figures there is not Formula or Calculation.
Below is the message which we can see in the BEX query for Corrupted Calculate Key Figure.
Diagnosis
Element ' XXX ' cannot be analyzed by the analytic engine without a definition.
System Response
Without a valid definition, the element will be ignored by the analytic engine.
Procedure
Provide a valid definition for element 'XXX'.
Could anyone please help me to retrieve query back to normal ???. Your are inputs are appreciated
Thanks,
HAyo could try rsrt in bw and try to regenrate the query thats all i got. .otherwise always make a copy before you start working on a query. if it still is coruupted then you will have to recrate it. if the query is in your bwq maybe the basis can do a transport( not recomended)back. good luck..
Maybe you are looking for
-
OTM: OpenScript fail due to
Hi, When I run an OpenScript in OTM it fails even though it runs fine in OOS. OTM gets as far as logging into PeopleSoft, but no further. The script was created using FT-Oracle EBS/Forms. According to the ResultsReport: Object not found: /web:window[
-
Issue while using FM L_TO_CREATE_POSTING_CHANGE
Hi All, We are facing an issue when creating a transfer order using the FM L_TO_CREATE_POSTING_CHANGE. We have developed a custom program to change the status (Zfield) of a specific SU in LQUA and update its stock category. The program creates the ma
-
Tried back way to download itunes 8 on a 10.3.9 and now it won't work!
I didn't realize when I bought my new iPod nano that it wouldn't work on my 10.3.9 iBook G4. I stupidly decided to try to download iTunes 8 without having to upgrade my computer. Someone on a blog said that you could download it if you went to /Syste
-
Hi Guys, Just wanted to know if Excel sheet Data can be imported to Webi and make our Report?? I have Excel sheet with 10,000 Rows,i want to import that and want to see Charts etc. Is it possible?? Thanks in advance.
-
For example, I want the rule to trigger when the target contains "brown hair". It should trigger when the target is "blue eyes, brown hair and ruby lips..." but *not* trigger when the target is "blonde hair and brown eyes". Thanks, Rob