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
Similar Messages
-
Count the no.of rows without using count function
Hi,
How to count the no.of rows without using the count function?
Thanks,they won't be 100% accurate. You're correct, Bluefrog, but the same goes for doing a count(*) (depending on the size of the table, ofcourse):
the table being queried might be under DML (deletes/inserts), and the next count(*) might give different results.
Both approaches will never be 100% accurate.
But simply selecting num_rows will be much much faster than doing a count(*).
Counting the number of rows always reminds me of this ongoing discussion, by the way:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:127412348064#14136093079164 ;)
Usually knowing the number of records by approximatly is sufficient, imo. 1000000 or 1000007 records: I don't care, don't need to know that.
I've never needed to know the exact number of records in a table in my code, or been given a requirement that forced me to. -
Do I have to use these functions in
Hi all,
To update some fields of the transaction mm02, I have seen a program written and these functions have been used in this program:
data : sequence LIKE T133A-BILDS.
data : bildtab like MBILDTAB occurs 0 with header line.
data : bildtab2 like MBILDTAB occurs 0 with header line.
data : KSTATUS LIKE T130M-PSTAT.
data : TKSTATUS LIKE T130M-PSTAT.
data : kzdch like rmmg2-chargebene.
data : anzgstatus like T130M-PSTAT.
data : tkbstatus like T130M-PSTAT.
CALL FUNCTION 'T130M_SINGLE_READ'
EXPORTING
TCODE = 'MM02'
IMPORTING
WT130M = T130M.
CALL FUNCTION 'BILDSEQUENZ_IDENTIFY'
EXPORTING
TCODE_REF = T130M-TRREF
KZRFB = 'X'
IMPORTING
BILDSEQUENZ = sequence.
CALL FUNCTION 'T133A_SINGLE_READ_AUSWG'
EXPORTING
AUSWAHLGRUPPE = '01'
BILDSEQUENZ = sequence
IMPORTING
WT133A = t133a.
CALL FUNCTION 'SELECTION_VIEWS_FIND'
EXPORTING
BILDSEQUENZ = sequence
PFLEGESTATUS = t130m-pstat
TABLES
BILDTAB = bildtab.
CALL FUNCTION 'MATERIAL_INIT'
EXPORTING
TCODE = 'MM02'
KZ_BERPRF = 'X'
KZRFB = ' '
IMPORTING
IT130M = t130m
KSTATUS = kstatus
TKSTATUS = tkstatus
KZDCH = kzdch.
select single * from t134 where mtart = mara-mtart.
CALL FUNCTION 'ANZGSTATUS_SETZEN'
EXPORTING
AKTYP = t130m-aktyp
MARASTATUS = mara-vpsta
T134STATUS = t134-pstat
TKSTATUS = tkstatus
IMPORTING
ANZGSTATUS = anzgstatus
TKBSTATUS = tkbstatus.
For what purpose are these functions used?
Thanks.By calling these Function modules - it is trying to identify the MM data tabs.
When you do a MM01, or MM02, you have different views for it like Basic data, Purch1, Costing , MRP etc. Think of a scnerio where you are trying to update a particular field of a certain tab.
Now the position and number of screens ( tabs ) keeps changing according to your config settings and material type. The whole idea of this code is to identify them.
You can simply run the FM 'SELECTION_VIEWS_FIND' after finding the corresponding data from tables T133A and T133M. You will get to see postition and list of tabs. So while doing a BDC on MM02 you already know - from the table control which row is to be selected.
hope it explains all your queries huh ? -
How to use count() function
Hi,
Following is XML data
<?xml version="1.0" encoding="UTF-8" ?>
<lookup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/lookup lookup.xsd"
xmlns="http://xmlns.oracle.com/lookup">
<value>
<scode>1001</scode>
<destination>NEO</destination>
</value>
<value>
<scode>1002</scode>
<destination>NEO</destination>
</value>
<value>
<scode>1003</scode>
<destination>OFS</destination>
</value>
<value>
<scode>1004</scode>
<destination>NEO</destination>
</value>
<value>
<scode>1005</scode>
<destination>OFS</destination>
</value>
</lookup>
I want to count number of occurances of node "value". I have used following expression:
<assign name="Assign_1">
<copy>
<from expression="count(bpws:getVariableData('receiveInput_Read_InputVariable','lookup','/ns3:lookup/ns3:value'))"/>
<to variable="outputVariable" part="payload" query="/client:ReadXML_Async_PRCProcessResponse/client:result"/>
</copy>
</assign>
But the result of this expression is always 0. Can somebody please point out where I am doing the mistake?
Regards
NitinNtin,
You could try using the ora:countNodes in built function which should provide the desired effect. I always tend to use this when counting nodes which is what i think you need to do here
For Example:
ora:countNodes('HumanTask1_1_globalVariable','payload','/task:task/task:userComment')
Would count the number of occurances of userComment
Thinks your would follow the following pattern:
ora:countNodes('receiveInput_Read_InputVariable','lookup','/ns3:lookup/ns3:value')
David -
[WebIntelligence Reporting] How to use count function with condition !?
Post Author: xuanthuyit
CA Forum: WebIntelligence Reporting
Hi everyone,
I want to make a report like this with WebIntelligence reporting.
I want to show the number of Outlet of each chanel (Horeca, Grocery, Convenience) at the end of report !
But I don't know how to do that with WebIntelligence Reporting.
Please help asap. . .
Thank you verry much,Post Author: jsanzone
CA Forum: WebIntelligence Reporting
xuanthuyit:
Apparently =count() [and use of a where] was permissible in previous versions of BusObjects, however, things in XI are different (as other users tell me, being XI is my first experience w/ BusObj...), so anyhow, here is the solution to your question.
You will have have to create two variables for each condition you have. One variable will be the "helper" and the other variable will be the "worker". For instance, create a variable called channel_x and the formula: =if(channel="haney";<metric>;0) (where "haney" is the name of your organization and <metric> is the metric you are using to count or sum things in your report). Once channel_x is saved create another variable called channel_x_count and the formula: =sum([channel_x]). Once channel_x_count is saved, then on your report towards the bottom you can use the Template bar to drag in a new table (perhaps you want to use the Horizontal Table type), and then you can drag channel_x_count into your new table. You will have to repeat the creations of more channel_x type variables (maybe call it channel_y and channel_y_count) or something more descriptive, but in any case substitute the "haney" constant for the next store you want to track, etc, etc. -
Using count function with grouped records
Hi all,
This seems like it should be real easy but I have yet to figure out a simple way to do this.
Suppose I want to count Opportunities that are grouped by Sales Rep. At run-time I am filtering this list with a parameter for Sales Stage and created date.
I've simplified this greatly, but here's what my setup looks like now:
Sales Rep* ---------Count*_
<?for-each-group:Opportunity[SalesStage=param1 and Created>param2];./salesrep?>
<?salesrep?>-------<?count(current-group()/Id)?>
<?end for-each-group?>
Total_
The only solution I have so far to get my grand total is to create a variable and keep a running total which I'll then display in the Total column. While it works, it seems like there should be an easier way, like doing a simple count(Id) to get the grand total. But since the Total appears after the end for-each-group, I lose the filter that was applied to the group so that count is invalid.
Any thoughts from the experts?
Thanks!To get grand total
use
<?count(/Oppurtunity[SalesStage=param1 and Created>param2]/Id)?>since you did not mention the complete xml, i assumed, Opportunity as the Root.
if not, put the full path from the root.
if you give some xml sample, and explain the output you wanted, we can fix it immediately.
go thru these too..some thing can be pulled from here .
http://winrichman.blogspot.com/search/label/Summation%20In%20BIP
http://winrichman.blogspot.com/search/label/BIP%20Vertical%20sum -
HOW TO USE COUNTER FUNCTION IN BEX
RESPECTED ALL
I WISH TO CREATE A FORMULA KEY FIGURE AT REPORTING LEVEL WHICH SHOULD GIVE ME OUTPUT AS
1
2
3
4
5
6
7
THE LOGIC IS " IF YIELD IS GREATER THAN ZERO COUNT 1 ELSE COUNT ZERO AND IN THE NEXT ROW IT SHOULD GIVE ME NUMBER 2 IF IN LINE FIRST IT GETS 1"
IN A NUT SHELL I WANT TO CALCULATE TOTAL NO OF COILS WHICH DEPENDS UPON TOTAL NO OF YEILD
FIELD BY USER.
THANKS
ABHAYHi Abhay,
We can get your scenario via calculated key figure..
Below is the calculated key figure:
(Nodim(field)<=0)0+(Nodim(field)>=1)*1... *
Field represents your perticular key field.in the above cal key fig...if the field is less than or eqaul to 0 counter will show as 0,
Second condition is if the cal key fig is equal to 1 it will show 1 as the counter.
In the same way you can implement your scenario...
Hope this helps you..
Best Regards,
Maruthi -
How to use multiple values in an IF condition in RTF
Hi,
I have a scenario as mentioned below.
IF column value in ('A','B')
display C;
end if
IF column value not in ('A','B')
display D;
end if
My query is how to provide multiple values in an IF condition.?
Thanks,
AnandBut suppose "x.jar" needs a library from "y.jar". How do you put another JAR on the classpath of an applet in a Web page?
<applet code="z.class" archive="a.jar,b.jar,c.jar"> -
Using Wild Card % in the IF condition of RTF templates
Hi every one, we have a requirements to make bold whenever COL1 ends with Total. Below logic is not working. Can any body help?
Thanks in advance.
<?if@row:COL1like '%Total'?> <xsl:attribute name="font-weight" xdofo:ctx="incontext">bold</xsl:attribute><?end if?>
-Phani Reddy
ADP india,
[email protected]You can do these
<?if@row:contains(COL1,'Total')?> <?end if?>
or
<?if@row:ends-with(COL1,'Total')?> <?end if?> -
OBIEE: Incorrect SQL - with count function uses ORDER BY instead GROUP BY
I made a basic report that is a client count; I want to know how many clients the company have.
But, when I run this report, OBIEE generates a ORDER BY sentence, instead a GROUP BY. Remember that I'm using count function, that is a agregation.
The SQL generated was:
select 'N0' as c1,
count(*) as c2
from
(select distinct T1416.CLIENT_INTER_KEY as c1
from
(select *
from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) T1836,
(select *
from prd.D_CLIENT) T1416,
(select *
from prd.D_CUSTOMER_ACCOUNT where SOURCE_SYS In ('ARBOR','PPB')) T1515
where ( T1416.DW_CLIENT_ID = T1515.DW_CLIENT_ID and T1515.DW_CUST_ACCT_ID = T1836.DW_CUST_ACCT_ID and T1836.MSISDN = '917330340' )
) D1
order by c1
The error that I receive is:
"Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: -1005018 message: [Sybase][ODBC Driver][Adaptive Server Anywhere]Illegal ORDER BY item Order Item: 'N0',
-- (opt_OrderBy.cxx 429) .
[nQSError: 16011] ODBC error occurred while executing SQLExtendedFetch to retrieve the results of a SQL statement."
If I substitute ORDER BY with GROUP BY and test it in Sybase, Ithe query runs without any problem.
select 'N0' as c1,
count(*) as c2
from
(select distinct T1416.CLIENT_INTER_KEY as c1
from
(select *
from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) T1836,
(select *
from prd.D_CLIENT) T1416,
(select *
from prd.D_CUSTOMER_ACCOUNT where SOURCE_SYS In ('ARBOR','PPB')) T1515
where ( T1416.DW_CLIENT_ID = T1515.DW_CLIENT_ID and T1515.DW_CUST_ACCT_ID = T1836.DW_CUST_ACCT_ID and T1836.MSISDN = '917330340' )
) D1
group by c1
Do you know why OBIEE generates this SQL??? Why uses, with a aggregation function, a ORDER BY and not a GROUP BY? How can I resolve this problem???
Regards,
Susana FigueiredoVerify your repository design and make sure that you have defined count aggregate on fact column. You would also need to define the content level of each dimension in fact table.
-
I have problems for to use Start function inside a case structure.
I am doing data acquisition using the Config, Start and Read functions, all them inside a while loop. I want to use Config function only when certain conditions occur, so I put the function inside a case and no problem. But when I put the start function inside the same case, the acquisition is not good. Please view my attachment. My application is client-server type.
Attachments:
scope_server(config_start).vi 160 KBBoxer,
I checked your example and have several easy but important suggestions for you:
1.- First, make sure that the first time you initialize the VI, the AI Config and AI Start are executed, because based on the debug I made, your program doesn't do it, and this is very important.
2.- Add an AI Clear after the acquisition is done, so that you release the resources. This is a good programming technique, and may help you solve your issue.
3.- Add an Error Cluster, so that you know if an error occurred at some point of the acquisition. This will help you track the issue.
4.- What do you mean by "the acquisition is not good". What does it happen? What does it do? Do you get an error? <- This is the reason of step 3.
5.- Finally, if you have doubts
programming AI, check one of the shipping examples of LV. They can give you a much clearer idea.
Hope this helps,
L Aguila
Applications Engineeer
National Instruments -
Count() function throws error in EQL query for metric
Hi
I am trying to use count function in EQL query for Metric Bar to show the number of occurrences of a record.
When the record type doesn't exist i expect the function to return count as 0. Instead the function throws a runtime exception and the whole Metric Bar portlet fails, with error No Results Available. Even though other components in the metric bar have valid results.
2013-02-21 13:03:51,216 WARN [MetricsBarQueryProcessor] The EQL query does not return any results.
2013-02-21 13:03:51,216 ERROR [MetricsBarQueryProcessor] The EQL query does not return any results.
2013-02-21 13:03:51,216 WARN [MetricsBarResultsProcessor] No statement results to process.
The EQL query i am using is
RETURN NUMBER_OCCURS AS SELECT COUNT(EMP_ID) AS NUMBER_OCCURS where EMP_NAME IS NOT NULL group;
I tried using COALESCE but that doesn't help.
Can some one please suggest a workaround to this?Srikanth,
Two statements are used here because the original question was pertaining to the null set (where there are employees in the nav state but no employees that fit the special analytics criteria in the navigation state). The question/answer has nothing to do with what is in the COUNT parentheses clause as Counting a null set will always give you NULL, not 0, no matter what you put in there.
What we're really doing, in the second part of the query, is writing a query over a set of data that is not the null set (i.e. the current navigation state). This allows the 0 value to come through in the case where the first analytics statement is evaluated over a null set of records. If there were truly no records in the navigation state, this too would return a null set and not zero.
Hope that makes sense, feel free to respond (either on here or offline) if it's unclear.
Regards,
Patrick Rafferty
http://branchbird.com -
Count-Function in Message Mapping
Hey, trying to map following structures:
message
-m1
--m11
-m2
--m22
-m3
--m33
to
message
-m1
--m11
-m2
--m22
-m3
--m33
-f1
--countItems
The nodes m1,m2 and m3 can appear 1..unbounded. In target structure I would
like to have the numbers of all nodes (m1,m2,m3).
For example: In this source structure m1,m2,m3 appear only one time. In the
field countItems I would like to have the number 3.
I tried the count function, but it could only count the structure where I used it (in
this case: f1).
How can I count the above-mentioned nodes?
thanks
chrisHey,
thanks for your answers.
But I still couldn't understand how to do this. I open the message mapping for field f1, but the count function could only be set on an target-element, so where to set the counters for m1,m2,m3? Do I have to insert extra fields under m1..m3?
If I do the counter would increment with every node, so if I have two times m1, in second tree of m1 a two will be insert. If I use the add function, only for these two tree the result would be three!
@Gangisetty Vijaya Bhaskarudu
Is this just one UDF? From where he knows, which nodes he have to count, if I have more than m1..m3, but only want to count this three?
@ sasitharan
same problem as mentioned above:
this doesn't work:
m1--count---\
I can't use m1 as input for count! Or do I have a wrong count function?
<b>....au damm, answered my own question. Of course. I use COUNTER and you use
COUNT!!!!!!!!!!!! I will try this with COUNT!!</b>
thanks
chris -
How to include the COUNT Function in business rule
Hi all,
I am working in oracle data quality in ODI.
This is regarding the business rule in Data quality.
I need to count the number of records when my status_type="A".
But when i include the COUNT function in business rule.
I find the following error as "*Unspecified Count Function*".
Waiting for ur valuable reply.
Thanks in advance,
JayaPradha PHi,
The following is the condition I have to be used
For eg:*Count records in DIM_SERVICE_ORDER_CODE where service_type = ‘P’*
But when i use COUNT function.
Im getting the error as "Unrecognised function count"
waiting for ur valuable reply
Thanks in advance,
JayaPradha p -
XL Reporter and Count function
Hi,
Using XL Reporter to produce financial reporting and sales analysis reporting is great. It would be good to be able to use count functions as well for other data analysis (ie in Service modules) without having to drop out huge volumes of data from the database, hide it and use the Excel countif functions to analyse the data.
An example is to provide reporting on the number of service calls in a period analysed by Problem Types, by Item Groups, Top 10 customers by number of calls etc.
This is all good supporting reporting but it is resource hungry to produce using the existing methods.
Edited by: Julie Jamieson on Aug 1, 2008 3:26 PMHi you all
Thats right, im doing like you: hiding lots of data... but it would be great to use a count function.
For example, i am doing a report where i need to count the number of invoices made for a sale of type a manufacturer brand.
If anyone have a solution, please share it.
Thanks
Luis Barros
Maybe you are looking for
-
CS 5.5 Install fails with package created by Adobe Application Manager
Hi all: I'm trying to install Adobe CS 5.5 on a 10.6.4 machine that already has CS 3 on it. I've created the package several times with the AAM, but when I go to install it on the client machine installer always throws errors (see logs below). I've t
-
Applets: location of class files
Can applets use classes from a directory other than the one holding the applet? I want to have some common classes used by applets that are scattered about in different directories. Anyone know if this is possible?
-
MacBook Pro Thunderbolt with black screen
Hi, my MacBook Pro 15" 2GHz, Core i7 with Thunderbolt, OS 10.6.7 has some problems: Sometimes I have to let run it during the night. When I wee it the next morning, it won't sleep, it is still on, but the screen stays black. Can't put it to sleep mod
-
Help on how to import static HTML web site in Portal v2
Hi I am new to Portal and I would like to know if there is a way to upload an entire static HTML Web site (pages and images) into Portal (v2) or do I have to re-create each pages one by one. Thanks for your time, Louis-Martin Rivard Covansys Canada
-
I can detect my Bluetooth devices using a BLE scanner and it says they can be connected but - My 5S will not pair with these devices