Count based on Result field of query
Hai experts,
I created a query that will display result the following format.
Vendor SourcePurOrg PurGroup Outstanding amount (Keyfigure)
197702516C RSAF PURCH ORG Not assigned 297,294.24
Result 297,294.24
200003048E JOINT PURCH ORG Not assigned 21,196.00
RSAF PURCH ORG Not assigned 44,063.52
Result 65,259.52
My requirment is I need to count the vendors if their Result exceed certain amount (eg: 65,000).in different SourcePurOrg.
how can i achive this based on one keyfigure result field..This is a very urgent requirment.Pls help..
Thank you
Anish
Hi
You can create replacement path variable on vendor & create one calculated key figure, this will give you the count 1 for each vendor.Then you can apply condition as '<65000' , it will give you the count for that condition.
Similar Messages
-
Create Materialized View based on Results from LDAP Query
Hi -- I'm trying to create a materialized view based on results from an LDAP query. Unfortunately, it looks like a materialized view can't be created based on a stored procedure, which is where the LDAP results are obtained (using nested loops).
Does anyone have any idea how to do this without first kicking off a stored procedure that populates a temp table which would be used to create the materialized view? I'm trying to minimize the steps that the DBA's will need to go through when refreshing this new view.
Thanks,
~ChristineCan you give us more details about the stored procedure you're calling. It will help to know what parameters are involved and what data types they are.
Off the top of my head though it looks like, at the very least, you would need a stored function that calls the stored procedure. I don't think there is any way to call stored procedures from CREATE ... commands. If you're going to create a stored function anyway ... well, you might as well just create a procedure that inserts values into a regular table instead of fussing with functions and materialized views. You'll probably want to schedule your new procedure to run periodically since it sounds like you'll need the values refreshed from time to time. -
Trouble hiding / showing element with DA based on results of query
Hi all,
I have a field that I would like to valid either on keypress or lose focus. What I need to do is query a table with the value entered to determine if it exists. If it does, I want to show a little green checkmark, if not a red 'x'. I figure that I can use getElementById() to hide or show the image, but I can't seem to figure out how to do that based on the result of the query.
I've tried this so far:
DA
event: lose focus
type: item
item: P3_PO_REF_NUMBER
condition: not null
true action: execute pl/sql code
code:
BEGIN
declare
l_exists number;
begin
select count(*) into l_exists
from PO_LINE
where BUSINESS_UNIT = 'METRO' and
(PO_ID = to_char(:P3_PO_REF_NUMBER,'FM000000000') or PO_ID = 'S'||:P3_PO_REF_NUMBER);
if l_exists > 0 then
apex_util.set_session_state('P3_VALID', 'VALID');
else
apex_util.set_session_state('P3_VALID', 'NOT_VALUE');
end if;
end;
END;page items to submit: P3_PO_REF_NUMBER
page items to return: P3_VALID
Eventually I thought that I'd create another hide/show DA based on the value of P3_VALID, but before I went much further, I wanted to check to see how this worked. It didn't. Error: exception thrown and not caught.
Any thoughts as to what I'm missing, or am I doing this completely wrong?
Thanks,
JoeOk, just for closure. I did get this working.
I ended up deleting the original P3_PO_REF_NUMBER item and recreated it, and everything began to work. As I was doing this, I noticed that it seemed like things would begin to go awry when I changed the item's name, even if I changed it back again. It was almost as if there was an associated between the DA that became corrupted once the item name was changed. If I took the item out of the page items to submit field, no error. Of course the DA wouldn't fire correctly then either because it wasn't getting any value changes, but when I added the item back into the page items to submit field, I go an error.
So:
When I created the second PO_REF_NUMBER item, I did not delete the original first, so the new one of course had to be named differently. Then I modified the DA to use the new item name (PO_REF_NUM). It worked! Cool. So, no wanting to get rid of the original yet, I rename it, and then renamed the second one to what the original was (I have other code using that item name). Then I changed the DA again...but now it failed - unless I blanked out the page items to submit field...
3rd time is a charm. So, this time, I made sure that no items were named "PO_REF_NUMBER", then I created the PO_REF_NUMBER again, naming it exactly as I needed it to be so I wouldn't have to change it later. Then I set out to tweak the field (size, etc), but did not touch the name. Now my DA is working nicely! It sets a hidden field's value, then another DA shows or hides an icon based on that hidden field's.
Hopefully someone will find this useful,
Joe -
Problem when Counting results of a query
Hi all
In our application, we use the Toplink Essentials Queryframework API to create queries because of JPA limitations.
Now I have a problem: I want to count the results of a existing query, i.e. I have a ReportQuery and I want to count the results of it.
I tried the following:
ReportQuery query = ...
ReportQuery countQuery = new ReportQuery(Pivot.class, builder);
countQuery.addCount(COUNT,
ExpressionBuilder.from("id", builder.subQuery(query)));
countQuery.setShouldReturnSingleValue(true);
return Integer.valueOf(session.executeQuery(countQuery).toString());
Now it seems that Toplink executes the query but the result is not correct, i.e. the count result is NOT the same as the number of results in the original query.
The subquery may contain group by's, a where clause and so on...
Anyone has an idea how to count the number of results of another query in Toplink?
It should have the same affect as a simple sql "select count(*) from (select ...)" query.
Regards
MichaelNot exactly sure what your doing, what does the original ReportQuery select?
You probably want to do something like the following:
originalQuery...
ReportQuery countQuery = new ReportQuery(Pivot.class, countBuilder);
countQuery.addCount("id");
countQuery.setSelectionCriteria(originalQuery.getSelectionCriteria());
You may need to also call rebuildOn() if you reuse the same selection criteria from a different query.
i.e.
countQuery.setSelectionCriteria(originalQuery.getSelectionCriteria().rebuildOn(countBuilder));
James : http://www.eclipselink.org -
Updating field in query result pls give me response asap
Hi,
i have a custom button in my page and when i press that button one more field going to modified(it is displaying some date)
problem is when i tried to modified from back end modified that query result (that action query date) from fret-end it is not modifying
i think i need to create dynamic vo or what?
if i am wrong
pls help me how can i solve this?
thanks®arding
srinivasI'm afraid what you've written is not clear. Without attempting to be rude your English is poor.
I suggest restating the problem.
CM. -
Need to run a query to select # of counts based on each month
Let's say I have a talble with 12 months, each month has some data.
I want to run a select count(*) to get result of how many rows per month, like Jan----100, Feb---90, etc.
How do I do that?
Thanks in advance.user569151 wrote:
Let's say I have a talble with 12 months, each month has some data.
I want to run a select count(*) to get result of how many rows per month, like Jan----100, Feb---90, etc.
How do I do that?
Thanks in advance.May be like this:
SELECT EXTRACT(MONTH FROM date_column),COUNT(*)
FROM TABLE_NAME
GROUP BY EXTRACT(MONTH FROM date_column); -
Change The Color Of Fomula Field Based On Results
I am using Crystal XI and I am familar with the Highliting Expert, but my question is can I have a formula field print red on the report based on a certain condition, blue on a different condition, etc. I am not sure how to code this if possible, so I will give an example:
If Sales ($100) - Cost ($50) = Profit ($50) then print field red
else if Sales ($80) - Cost ($40) = Profit ($40) then print field green
else print field blue.
I will need to add additional criteria to each IF statement which is why I am not using the Highliting Function, so my basic question is how to code the formula to have field field print different colors based on the field values.
Any help would be geatly appreciated.
Thanks JimHi Jim,
Right click the field >> Format >> Font Tab.
Find 'color' >> Click the little icon with a pencil and X-2 symbol to open the formula box.
Place your formatting formula in the box:
If @Sales - @Cost < 0 Then
Formula = crRed
ElseIf @Sales - @Cost >= 50 Then
Formula = crGreen
Else
Formula = crBlue
End If
Full list of Color Constants are in the functions list of the Formula Editor.
Art -
CSS11501 Sticky connection based on msisdn field
Hi there,
Mobile GSM clients connect through WAPGW over CSS to real servers. We want to stick their connections based on msisdn field. As it seems this field is not recognized by CSS since "lookup fail" counter increases ant there is no match. We have tried with header-field msisdn exist and also with partial match of phone number just for testing purposes (header-filed msisdn contain ...). The result was the same. I believe this can be a case of description of msisdn field in http header which is not standardized and depends on WAPGW. Our WAPGW is sending this field like "User-Identity-Forward-msisdn=". How can we convince CSS to recognize this field?
Thanks for help.
Branko MlakarBranko,
the CSS looks for the following header => MSISDN: .....
Anything else will not match.
This is not configurable.
Regards,
Gilles. -
WEB BASED MAPPING APPLICATION TO DEVELOP QUERY UTILITY USING MAPVIEWER
Dear Sir,
please any one can answer me as soon as possible its very urgent
WEB BASED MAPPING APPLICATION TO DEVELOP QUERY UTILITY USING MAPVIEWER
I As oracle mapviewer Chapter 8 (Oracle Maps) says generating our own Web based mapping application we are trying to generate our own maps for our own data contains in our layers like example boundary lines and roads and etc. and we are following complete example as described in Oracle Mapviewer Document Chapter 8.
Before this step we tried with demo data downloaded from OTN mvdemo. And we downloaded latest demo today itself from the OTN and imported into our database schema called mvdemo. And we copied all three jar files mvclient and mvconnection and mvpalette into our jdeveloper .
II. We created a jsp to execute the following code from oracle mapviewer chapter 8 documents
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/customizable" prefix="cust"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/jwcache.tld"
prefix="jwcache"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/fileaccess.tld"
prefix="fileaccess"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/jesitaglib.tld"
prefix="JESI"%>
<f:view>
<html>
<head>
<META http-equiv="Content-Type" content="text/html" charset=UTF-8>
<TITLE>A sample Oracle Maps Application</TITLE>
<script language="Javascript" src="jslib/loadscript.js"></script>
<script language=javascript>
var themebasedfoi=null
function on_load_mapview()
var baseURL = " http://localhost:8888/mapviewer/omserver";
// Create an MVMapView instance to display the map
var mapview = new MVMapView(document.getElementById("map"), baseURL);
// Add a base map layer as background
mapview.addBaseMapLayer(new MVBaseMap("mvdemo.demo_map"));
// Add a theme-based FOI layer to display customers on the map
themebasedfoi = new MVThemeBasedFOI('themebasedfoi1','mvdemo.customers');
themebasedfoi.setBringToTopOnMouseOver(true);
mapview.addThemeBasedFOI(themebasedfoi);
// Set the initial map center and zoom level
mapview.setCenter(MVSdoGeometry.createPoint(-122.45,37.7706,8307));
mapview.setZoomLevel(4);
// Add a navigation panel on the right side of the map
mapview.addNavigationPanel('east');
// Add a scale bar
mapview.addScaleBar();
// Display the map.
mapview.display();
function setLayerVisible(checkBox){
// Show the theme-based FOI layer if the check box is checked and
// hide the theme-based FOI layer otherwise.
if(checkBox.checked)
themebasedfoi.setVisible(true) ;
else
themebasedfoi.setVisible(false);
</script>
</head>
<body onload= javascript:on_load_mapview() >
<h2> A sample Oracle Maps Application</h2>
<INPUT TYPE="checkbox" onclick="setLayerVisible(this)" checked/>Show customers
<div id="map" style="width: 600px; height: 500px"></div>
</body>
</html>
</f:view>
<!--
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>mapPage</title>
</head>
<body><h:form binding="#{backing_mapPage.form1}" id="form1"></h:form></body>
</html>
-->
<%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_mapPage--%>
III. When we run this jsp it’s giving us following Two errors
1 Error: ‘MVMapView’ is undefined
Code: 0
URL: http://192.168.100.149:8988/MapViewerApp-WebProj-context-root/faces/mapPage.jsp
2 Error: ‘themebasedfoi’ is null or not an object
Code: 0
URL: http://192.168.100.149:8988/MapViewerApp-WebProj-context-root/faces/mapPage.jsp
Please let us know what could be problem as soon as possible. Very urgent
Please let us know where we can find Mapviewer AJAX API’s for Jdeveloper Extention
Thanks
KabeerI currently use parameters, and they are passed from the form to the report. Report is then generated based on a function returning ‘strongly typed’ cursor. The ‘strongly typed’ cursor in my case returns a record consisting of an orderly collection of fields.
This collection of fields is returned by another function that relies on the IF … THEN logic.
However, the number of IF ... THEN statements is quite large (currently 64 covering all possible combinations of 6 parameters available in the form).
I would like to avoid the large number of IF … THEN statements, and hope that there is a way of passing a string to a query, where the Dynamic SQL would in Select close and Where close reflect parameters passed by the form.
In addition to this I would like to avoid creating and populating a table or a view dedicated to the report, because this may lead to a conflict in case of multiple users concurrently generating reports with different choice of parameters.
Edited by: user6883574 on May 28, 2009 9:16 PM -
How to execute a procedure depending on the result of a query?
Hello, I'm new in ODI.
I want to execute a procedure depending on the result of a query Oracle table.
We have a Oracle Table whit a column that contains two possibles values.
I want read the table, row by row, and depending on this value, execute a Procedure or execute another.
How can i do?what you need to do is
1. create a variable which "new_var2" which has the count of the number of rows you want to process. must be data type numeric.
2. copy "new_var2" to the package screen.
3. duplicate the "new_var2" on the package screen and evaluate the variable and test for "> 0" zero, call it "new_var2_E"
3. create a new odi variable "new_var1" with a refresh of "select field1 fom (select field1,rownum as rownumber from tablex) where rownumber = #new_var2" in the relevant schema and technology.
4. copy "new_var1" into your package (some where in the flow)
5. right click the "new_var1" variable in you package screen and you should get the option duplicate step (click on that)
6. select the the duplicate "new_var1" on the package screen and correct the the name to something meaning full to you "new_var1_E", also change the "type" to "evaluate variable" then you should see a "value" box. enter one of the values you want to test in the box (remember do not put in quotes ' )
7. now back on the package screen join the "new_var1" to the "new_var1_E" with an OK line
8 you now join "new_var2" to "new_var2_E" with OK
9 you join "new_var2_E" to "new_var1"
10. you then join the "new_var1_E" with an OK or a KO line to the relevant procedure.
12. you need to duplicate "new_var2" in the package screen one more time this time and call it "new_var2_D" set the type to evaluate and then select the increment of -1
13. the relevant procedure to "new_var2_D" with an OK
14. join the "new_var2_D" to the "new_var2_E" with an OK
15. this should close off the loop now the exit point is "new_var2_E" with a KO line to the next part of your process....
Basically you should end up with a loop on new_var2 decementing, and it is used to get a specific next record row from your table.
Hope this helps, sorry it is a little long winded..
Edited by: DavidGD on Feb 8, 2009 3:29 PM -
Result of the query is not filtered as value given in Select Option variabl
Hello ,
A Select option Variable is created on Navigational Attribute( ZINV_PROG) of 0WBS_ELEMT.
The Compound Key for object ZINV_PROG(Investment program) is APPR_YEAR( Approval Year)
This ZINV_PROG object does not bear Master data.
The values in the field get populated as you load Master data of 0WBS_ELEMT.
The values for this objects is as shown below:
APPR_YEAR ZINVPROG
2005 ESCCCAPS
2007 ESCCCAPS
2008 FIRE
2006 CAPITAL
A select option variable is craeted on this Navigational attribute.
When you execute the query , On the selection screen of the query..
If you provide i/p for Investment programm field as 2007 ESCCCAPS, the data should ideally be filtered for this values only.
But the result of the query shows data for both values 2005 ESCCCAPS and as well as for 2007ESCCCAPS.
Let me know how to sort this issue.
Points will be assigned for the correct and helpfull answere.
Thanks,Thanks Srini for your prompt explanation.
My Question is if Approval year is a compounded key of ZINV_PROG object why data would not get filter out directly.
I mean on the screen for this particualr variable i take help - F4 to see values there you are able to see all the values of Investment programm along with the apprroval year.
If i select value as 2005 ESCCCAPS from the help F4 screen then ideally data should be fileterd out for this particular value. But it is not happening so.
Is that so in Query desgining that if you creating a variable on Nav Attribute, and that particular Nav attribute has a compound key then if you want to filter out the data for this Nav attribute correctly you would also require to create a variable for Compound key also.
Please let me know
Thanks -
Multiple occurances of lin itm seg based on a field using graphical mapping
Hi
I have a scenario where in i have to populate the target segment multiple times based on quantity field LFIMG
Source structure in IDOC and target structure is XSD. In the following we need to have multiple occurances of S_LIN based on LFIMG. So if the value of LFIMG is 6 we need to have 6 occurances of S_LIN.
Source structure
E1EDL24 (segment)
LFIMG (field)
Target structure
ITEM (segment)
GSHL (segment)
S_LIN (segment)Hello Kalyan,
You need to write an udf like this.
LFIMG (change context Queue)---->UDF ---> S_LIN
Variable : source and separator(",")
String[] values = source.split(separator);
for(int i = 1 ; i < values.length ; i++){
result.addValue(values<i>);
result.addValue(ResultList.CC);
Regards
Pothana -
How to store multiple counts based on creation date
Hi,
I want to retrieve the count of number of risk for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015 and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2 and
then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
Please help.
Thanks in advance.Hi,
I want to retrieve the count of number of risk for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015 and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2 and
then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
Please help.
Thanks in advance. -
Choose display template based on result type - Content search webpart
Hi
Is it possible to choose display template based on result type in content search webpart same like search results web part? If not available can it be achieved programmatically?
The content search web part is queried against document content type. Based on the document type, the document has to be seen in the hover template.
Please advise.Hi,
From your description, my understanding is that you want to choose display template based on result type as search result Webpart in Content Search Webpart.
You could customize your display template for Content Search Web Part, please refer to this article:
http://www.benprins.net/2014/05/21/sharepoint-2013-custom-display-template-for-content-by-search-web-part/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Hello All
Can any one let me know how the counter based planning can be execute.
If the maintenance is required oon one equipment after 300 hrs & 1000 hrs.
I try to do this but not able to execute properly
1) create equipment
2) create 2 measuring point against the same equipment.
3) create cycle (ip11z) with same frequency.
4) create plan (ip43) and then assign the cycle set and then attach both counter to that plan.
5) after scheduling ip10 then creating measuring document
6) finally move to dead line monitoring
here at 260 hour the system is generating order but that order contain operation of both frequency (300 hrs &1000 hrs)
i also check the hierarchy, in (ip11z ) the hierarchy field is not available like as in ( ip11)
Thanks in advance
kapilHello Sandeep
Thnx for your reply but still i am in vain pl have a look elow what i did
I create strategy (E)
Scheduling indicator u2013 time
Strategy unit- H also mention call horizon, n some other parameters
In Packages
1) 288 H 300 hour 1H 1
2) 984 H 1000 hour 2H 2
hour UOM Description Short Descript Hierarchy
Then I create M-Plan via IP42 with the same strategy and attached the task-list. So there is no field to put the counter
May be I am wrong some where ,just review the same and let me know if miss some thing
Regards
Kapil
Maybe you are looking for
-
Creating a slide show from an event reordering slides
I'm trying to take a event imported into iPhoto from a cd reorder the slides and do a slideshow to export to iDVD. I'm having a time at getting the slide show to start on the slide I set to the key slide and go through each photo in the order they ap
-
Help with Premiere elements 9 trial
Hi, I am new to this, and need a little help.. I have the trial version of Premiere Elements 9 and I'm finding that when I try to split a clip in two using the scissors button, that it goes into auto analyzer, which seemingly takes about 6 - 10 minut
-
CS6 Master Collection went from FULL ACCESS to TRIAL?!?!
I received the serial number for the CS6 Master Collection through my University and now after a year or so of having full access to it, it's telling me to continue my TRIAL or enter the license. I tried re-entering the number again and it's telling
-
Dear All, I have created a PO and saved. Then in change mode, i try to enter the output type ZPO4 which is ALE type, the line appears with medium, partner etc. But while saving the PO the below error appears and output messages not getting saved. Leg
-
Length for Screen Repairs!?
I just wanted to get some feedback for how long a powerbook screen repair usually takes. Feel free to post first hand accounts about your repair process. I sent my powerbook in for a backlight power inverter repair and it's taking longer than I expec