If - else condition in RTF
Hello,
I have four columns. The value of the fourth column depends on the first three columns. Here are the conditions. Col1 is always 0 or less than 0.
1) if col1 = 0, then col4 = 0
2) if (col2 + col3) + col1 >0, then col4 = col1
3) if (col2 + col3) + col1<0, then a) if col2 + col3 >0 then col4 = col1 - (col2 + col3)
b) if col2 + col3 <0 then col4 = 0
How can I write the if-else statements for the above mentioned conditions?
Please Help!
I would suggest handling this at the query level using a case statement.
Similar Messages
-
I have to use count function in "if-else" condition in rtf tempelate
I have a nedd to use count fucntion in my rtf fucntion in IF-ELSE condition like this :
if
(count INVOICE_LEVEL from xml where (INVOICE_LEVEL=SM_SUMMARY_LEVEL)) = (count coloumn_A from xml ) --- if the count matches
THEN print "NO DATA FOUND"
else --- if not
end if ;
--------XML------
<COMP123>
<SM_SUMMARY_LEVEL>2</SM_SUMMARY_LEVEL>
<SM_CHARGE_HEAD>2</SM_CHARGE_HEAD>
<INVOICE_LEVEL>2</INVOICE_LEVEL>
<RCVR_ADDRS3_PART1>SG</RCVR_ADDRS3_PART1>
<RCVR_ADDRS3_PART2>ASIA ,</RCVR_ADDRS3_PART2>
<TXN_CSTMR_REF>ABC-DEF</TXN_CSTMR_REF>
<TAX_ID>PCT-ID</TAX_ID>
</COMP123>
<COMP123>
<SM_SUMMARY_LEVEL>2</SM_SUMMARY_LEVEL>
<SM_CHARGE_HEAD>2</SM_CHARGE_HEAD>
<INVOICE_LEVEL>2</INVOICE_LEVEL>
<RCVR_ADDRS3_PART1>SG</RCVR_ADDRS3_PART1>
<RCVR_ADDRS3_PART2>ASIA ,</RCVR_ADDRS3_PART2>
<TXN_CSTMR_REF>ABC-DEF</TXN_CSTMR_REF>
<TAX_ID>PCT-ID</TAX_ID>
</COMP123>
can any one help me to write the correct syntax and logic for this .
THANKS!I am using the below way but it is not working as desired it is always printing the derived value.
<?xdofx:if (xdofx:round((to_number(to_char(SYSDATE,'JSSSSS'))-to_number(to_char(to_date(DOB_DATE, 'YYYY-MM-DD'),'JSSSSS'))) div 100000)) <= 30 then '(1-30)' else '(1-100)' end if?>
Let me know if i missed anything..
Thanks,
Jana -
Using OR condition in RTF Template
Hi,
How to use OR condition in RTF?
say for example,consider the EMP table.
I want to show the employees of department 10 and 20 in my XML Publisher report.
How can i write --
if deptno = 10 or deptno =20 in RTF templateyou can add the condition in RTF template
<?if:XMLfield=30 or XMLfield=10 ?> to display <?end if?> -
IF - Else condition is not working properly in Bex Query Designer
Hi All,
I have a KF called KPI Value. Based on the KPI Value, my report display has to show by using the if-else condition. If the KPI value is '999999' then that particular KPI value has to display as 'X' against to that KPI No. Thats all my requirement. To achieve this I have created a formula based on the KF.
(KPI Value == 999999)*(1/0)+(KPI Value <> 999999)*(KPI Value)*1
Unfortunately, the above expression is shwoing the entire colmn as 'X' irrespective of the KPI value. i.e., logic is not working Could any one please suggest how to achieve this requirement. Your assistance is highly appreciable and very helpful. Thank you in advance!!!
Best Regards
Venkat...AL,
I can visualize how condition should give results. The problem here is reality, I tired in my system with your formula and I got like as I mentioned.
If you observe closely your If..else formula, (KPI Value == 999999)*0+(KPI Value <> 999999)*KPI Value
If KPI Value == 999999 Result is 0, Else(Assuming) KPI Value <> 999999 Result is other nos like 1111, 2222 etc.
Actually it is not If..else, it is IF..ENDIF. Both conditions should get satisfied to give below:--
KPI value Formula
9999 X
1111 1111
2222 2222
9999 X
3333 3333
4444 4444
9999 X
In the course of adding both conditions results, system is not able to add 0+ Other Values in single column. So it is giving mixed values * like below:--
KPI value Formula
9999 X
1111 *
2222 *
9999 X
3333 *
4444 *
9999 X
Note: Once again I want to say it is not to prove you wrong. Let's get some clarity on the issue. I might be also wrong. But I want to know the actual result. If you can test it tomorrow and let me know..it would be great.
Regards,
Suman -
hi all,
can i have between condition in RTF. i'm trying to use <?if:+ExpirationDate+ between StartDate and EndDate ?> but doesn't work.
any idea about this?
please share your experience.thx
rgrds,
dityoNo,
There is no syntax called Between.
But you can use, > and < , if the dates are in canonical format. -
RETURN Clause in IF...ELSE Condition in PL/SQL Block
Hi
Could you please explain me the importance of a RETURN Clause in IF..ELSE Condition in PL/SQL Block with
an example.
Regards
Nakul.VHi,
RETURN clause permits get out of the block. For more information you can see [Using the RETURN Statement|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/subprograms.htm#sthref1683]
SET SERVEROUTPUT ON
BEGIN
IF 1 = 1 THEN
dbms_output.put_line('Before return');
RETURN;
ELSE
dbms_output.put_line('Else');
END IF;
dbms_output.put_line('After if');
END;
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> BEGIN
2 IF 1 = 1 THEN
3 dbms_output.put_line('Before return');
4 RETURN;
5 ELSE
6 dbms_output.put_line('Else');
7 END IF;
8 dbms_output.put_line('After if');
9 END;
10 /
Before return
PL/SQL procedure successfully completed
SQL> Regards,
Edited by: Walter Fernández on Dec 12, 2008 9:41 AM - Adding output
Edited by: Walter Fernández on Dec 12, 2008 9:43 AM - Adding URL... -
Query on handling else condition in Oracle Business Rules.
Hi all.
I am working on Jdeveloper 11.1.1.1.0 Business Rules. While creating rules... i am able to write if conditions around the facts and attributes and also replicate the same using decision tables and is able to derive the action.
My Question is.. can i write an else condition which should be executed when none of the if condition are matched. If we can how... Instead of else condition, is there any way that we can initialize the facts and attributes to be derived to a default value.
Please help me guys in this... If this is not the right foru,... please redirect me to the correct one.. coz i couldnt find a forum for oracle business rules..
Thanks
EldhoThanks a lot for the response..
I have posted the query in
Query on handling else condition in Oracle Business Rules.
Thanks
Eldho -
Procedure with out parameter in if-then-else condition
Hi,
I want to fetch the out parameter of a procedure inside another procedure that has if-then-else condition.
<<Proc1_start>>
if ..
then <<proc2_>> --- with out parameter
end if;
<<proc1_end>>
How to do this...
Thanks.Ummm, the same way you would do it anywhere else?
Declare variable in proc1 to hold the output of proc2 and then call proc2.
John -
Hi,
I have RTF template which contains the field to display the column name. Below are my help text.
COLUMN1 is my XML tag and displaying AQUA color in my excel output.
<?COLUMN1?><xsl:attribute xdofo:ctx="block" name="background-color">Aqua</xsl:attribute>From above scenario, i need to add one more condition if there is no value in my XML tag then don't display the field in my excel output. For example. I have COLUMN1 and COLUMN2 XML Tag. Only COLUMN1 contains the value but COLUMN2 not. In my excel output the COLUMN2 value should not display.
ThanksPlease see if (How to make condition using XML tags to check NULL values in XML Publisher templates? [ID 414022.1]) helps.
Also, see XML Publisher Guide which can be accessed via http://www.oracle.com/technetwork/documentation/applications-167706.html
Thanks,
Hussein -
"Or" condition in RTF Template
Hello,
In my RTF template, I try to test a statement for two values. I tried
<?xdofx:if :A!='0' or B!= '0'?>
<?if:A!='0' or B != '0'?>
It doesn't work : there isn't any error but the result is wrong.
Is there another syntax I've got to use ?
Thanks
Version : BI Publisher 10g
Edited by: jbg on 4 oct. 2011 23:49Condition usage looks fine.
Do these conditions individually work? Whats is your requirement?
If possible paste a sample xml here -
If like condition in rtf (template for oracle report)
i'm begineer developer in oracle ebs i'm using report builder and rtf (xml) template to build report
can anyone help my i want to make 2 layout in 1 template (1 rtf file) and give condition with if, lower and like (in sql i'm use like) but is error
i give this query in my rft template:
<?if: lower(WORK_ORDER_TYPE) like 'breakdown'?>
<?start:body?>
my_template
<?end:body?>
<?end if?>please help my for this problem
thank you very muchYou can use choose too,
note: the conditions are same
<?choose:?>
<?when: SHIP_COUNTRY_CODE=’IT’?>
<?concat(‘Iscrizione Registro AEE n.’,WEEE_REG_NUM)?>
<?end when?>
<?when: SHIP_COUNTRY_CODE=’IT’?>
<?concat(‘WEEE Registration No.’,WEEE_REG_NUM)?>
<?end when?>
<?end choose?> -
Color format upon condition in RTF
Hi
will anyone help me in this issue i've a column i want when it be a negative value to display its font in red . how can i apply that in rtf template ???See this related thread - BI Publisher conditional formatting
Srini -
Menu parameter and condition in rtf template
Hello Guys,
I have a problem with the .rtf xml condition for my
menu parameter.
<?sum(COUNT
(../P_TIME_2 =2011)
)?>
the above does not work. I was wondering if a "IN" clause
or something is needed but I dont know the syntax well.Hello AlexAnd,
Thanks for your reply. Unfortunately I cant post the XML here (I dont even know how to see the xml).
Let me explain what I did so far:
I just added a field using the BI publisher Word Plugin (.rtf).
BI Publisher Tab - > ab¦Field - > select fied and "sum" as caluclation method in window and that popped up- > double click on field and look
at the code.
Now this code says
<?sum(mySalaryCount)?>
I want to sum up mySalaryCount from the database but only when the column for a specific row
has the right year value.
lets say the one that has the value 2011. So I extend to code.
<?sum(mySalaryCount)
(../menuParamter_selected_year =2011)
?>
the problem is, the above does not work. it works for "normal" parameters but does not seem to work for
menu parameters (as set in the bi publisher data model)
I guess the menuparameter is a list/array and hence the = is not the right operator.
*in my case a menu parameter -
SUM function with condition in RTF template
Hi All,
I have a problem in calculating the SUM in RTF template with condition,
Here is the XML
- <LIST_G_LINE_NOTES>
- <G_LINE_NOTES>
<LINE_TRX_ID>1567856</LINE_TRX_ID>
<LINE_ID />
- <LIST_G_TRX_LINE>
- <G_TRX_LINE>
<CF_ITEM_NO>SDCN1144B</CF_ITEM_NO>
</G_TRX_LINE>
</LIST_G_TRX_LINE>
- <LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
- <G_LINE_EQUIVALENT_UNIT_PRICE>
<LINE_EQUIVALENT_UNIT_PRICE>-15.99</LINE_EQUIVALENT_UNIT_PRICE>
<LINE_EXCHANGE_EXTENDED_AMOUNT>-223.86</LINE_EXCHANGE_EXTENDED_AMOUNT>
<CUSTOMER_TRX_LINE_ID>1567856</CUSTOMER_TRX_LINE_ID>
</G_LINE_EQUIVALENT_UNIT_PRICE>
</LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
- <LIST_G_TRX_LINE>
- <G_TRX_LINE>
<CF_ITEM_NO></CF_ITEM_NO>
</G_TRX_LINE>
</LIST_G_TRX_LINE>
I need the summation of field LINE_EXCHANGE_EXTENDED_AMOUNT with the condition CF_ITEM_NO!=''
can anybody help me with the solution.
Thanks in AdvanceKavipriya,
Here is the XML
<LIST_G_LINE_NOTES>
<G_LINE_NOTES>
<LINE_TRX_ID>1567856</LINE_TRX_ID>
<LINE_ID />
<LIST_G_TRX_LINE>
<G_TRX_LINE>
<LINE_DELIVERY_ID />
<DISCOUNT>0</DISCOUNT>
<CP_LN_TAX_AMT />
<CF_ITEM_NO>SDCN1144B</CF_ITEM_NO>
</G_TRX_LINE>
</LIST_G_TRX_LINE>
<LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
<G_LINE_EQUIVALENT_UNIT_PRICE>
<LINE_EXCHANGE_EXTENDED_AMOUNT>-223.86</LINE_EXCHANGE_EXTENDED_AMOUNT>
</G_LINE_EQUIVALENT_UNIT_PRICE>
</LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
</G_LINE_NOTES>
Edited by: user13012317 on Mar 10, 2011 11:00 PM -
Implementing if then else condition
Hi! All
It would be very helpful if i can get answer of how to implement the condition below, using the functions available in graphical mapping editor....
I need to map 2 source fields to 1 Target field, based on the condition that field(source) is populated in the target field only if field 1 is null.
Source----->Target
part_id1----
>part_num(if part_id1 is null,then part_id2)
part_id2----
>
I tried using if then else function, it is working fine but errors out when part_id is null....need to make it work even when part_id1 or part_id2 is null.If both fields are null it should not populate anything.The boolean function is not accepting null inputs...
Please, let me know if there is a better way to implement this logic...Thanks a lot!
Regards,
PatrickJones,
Have this logic in your mapping:
part_id1>exists>and
part_id1>equals(textfunction)>null(take constant and dont put any value in it)>equals(text funciton)>false
Give the above two to if
Then in the then part give part_id1 and in the else part give part_id2.
So in the above if part_id1 exists and equals to null then part_id2 will be output and part_id1 exists and not equals to null then part_id1 will be the output and part_id1 doesnot exist then part_id2 will be the output.
Regards,
---Satish
Maybe you are looking for
-
Error While Activating an Activity
Experts, Can you please explain if you understand the following error I got while activating an activity to DJ1: CBS Build Log - [ SAO_SERVICES_D/com.aramco_SERVICES_1/default/ /aramco.com/esMasterDC ] ndi1 SAP Component Build Server Develop
-
Acrobat 9 Update made creating pdfs in cad slower
I recently purchased a new Dell Computer with Acrobat 9 Pro on it. I received a message from Adobe that an update was available. I installed the update and now when I create a pdf in AutoCAD 2008 it takes about 9 seconds to create a pdf page. Prior t
-
How do I set timeout property for JMS adapter in BPEL in SOA Suite 10g ? Scenario : In one of the business scenarios, a JMS message in enqueued to WebLogic JMS queue from BPEL process. There is a asyncronus invoke activity to the JMS adapter partner
-
Problem seems to have started after updating to FF5. (At least, I do not remember having the problem with versions of FF4.) The contents of ALL file folders in the Bookmarks Menu are present and accounted for, but only some of the contents import for
-
InDesign CS6 Crash MSVCR100.dll
Same issue as this thread: http://forums.adobe.com/message/4432510#4432510 Our company has purchased Adobe CS6; For our environment, our users are standard, locked down users with no rights to install software; On both of our Windows XP SP3 and Windo