How to compare group level value
Hi all,
I have prepared a very simple report like :
Group A: 60(maximum of this group A)
a1 40
a2 60
a3 20
Group B: 53
b1 46
b2 47
b3 53
GroupC: 89
c1 89
c2 87
c3 76
now i want to display the max value between (group B and group A )+ (value of group C) in a cell.
Thanks in advance
Hi,
I think you will need to create a variable that excludes items in group C.
v_GroupC_excluded.
=if([Group]="C";-9999;[value])
then create a second variable with report contexts
v_MaxValue
=MAX([v_GroupC_excluded] In Report)
This can then be added to value when the group is C.
I have not been able to test this as I am currently reinstalling, but it should work. Let me know how you get on.
Regards
Alan
Similar Messages
-
How to compare dropdown pre value with post value in sharepoint designer list workflow
How to compare dropdown pre value with post value in sharepoint designer list workflow
Hi,
Can you provide more details about your requirement? It would make others easier to find a solution for you.
By default, a workflow will be triggered after submitting data in the NewForm or EditForm.
If you want to monitor the value changed in a drop down menu which is supposed to be in NewForm or EditForm, it would be more appropriate to apply custom JavaScript in the NewForm
or EditForm page.
About how to detect the value changed using JavaScript, the demos in this thread would be helpful:
http://stackoverflow.com/questions/12080098/dropdown-using-javascript-onchange
Thanks
Patrick Liang
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] -
How to compare the date value with the date datatype column?
Hi,
I am executed a query to get output for the particular date in two different database.
I got output in one db environment, but in the another environment i didnt get the output.
APP_DECISION_DATE column contains date datatype
ex:
SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE = TO_DATE('23-JAN-07',
'DD-MON-YY'); 2
DECISIONED_STAGE_ID DECISIONED_STAG
2006060106 SYSTEM
DATABASE - II
SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE=
TO_DATE('31-JAN-2007','DD-MON-RRRR') and application_id=2007010028552;
no rows selected
in the same db i got the output while i used the TO_DATE(APP_DECISION_DATE)
SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where TO_DATE(APP_DECISION_DATE)=
TO_DATE('31-JAN-2007','DD-MON-YYYY') and application_id=2007010028552; 2
DECISIONED_STAGE_ID DECISIONED_STAG
2006060113 SYSTEM
is it necessary to use TO_DATE function while i am using the data datatype column in the WHERE CLAUSE?
Thanks in advance.
sivaSorry & thanks sathish,
Now i got the result.
SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE BETWEEN TO_DATE ('31.01.2007 00:00:00', 'DD.MM.YYYY HH24:MI:SS') AND TO_DATE ('31.01.2007 23:59:59', 'DD.MM.YYYY HH24:MI:SS')
2 and application_id=2007010028552;
DECISIONED_STAGE_ID DECISIONED_STAG
2006060113 SYSTEM
================================
But one doubt,
When i created the column with the date datatype how it gets the time value,
And in one environment db i got the result but in another environment i dont get,
Shall i want to change any session status of date? -
How to hide group header values
Hi
I grouped data on basis of pointdescrption in my report.
bu twhen i run the application, all the gropupheader names are dispalying
in left side of report. lke
desc1
desc2 etc.
but i don't want to show groupheader names.
give me solution.
ThanksMorning Swetha,
I see you are still having problems with the same report?.
There are two ways to organise the group, one would be to create two groups, one will show only ID's and other would show the name (only once).
I have had the similar issue where my Customer Account was showing up on each group level.
What I did was created Customer account group first, then created the ID's group. Then placed all my total counts etc in 2nd group footer.
This time when I ran the report, it shows customer account only once, and IDs were only repeated as I wanted.
Is that what you are trying to achieve?
Regards
Jehanzeb -
How to compare text box value with the table data??
Hello ALL,
I created one stored procedure in DB,it is as follows:-
CREATE or replace PROCEDURE chkUser
u in varchar2,
p in varchar2,
ap out varchar2
is
begin
select count(*) into ap from tbuser where loginid = u and password = p;
end;
And at the front end I have designed a form with 2 text boxes, now my question is I wanna compare these text box values(which user enters) with the data of the table....??? something like control (may be I am not sure)..... ???
If anybody can help me out with this issue...... help will be appreciated
Thank you.
regards,
Kumarhi Elise,
I'm always getting the Error Message as "Invalid Creditianls"... let me tell you the whole scenario with sql synatx.
I have created tables as:-
CREATE TABLE "TBUSER"
( "LOGINID" VARCHAR2(30) NOT NULL ENABLE,
"PASSWORD" VARCHAR2(30),
CONSTRAINT "TBUSER_PK" PRIMARY KEY ("LOGINID") ENABLE
than I created the Procedure on tbuser, it is as:-
create or replace PROCEDURE logincheck
u in varchar2,
p in varchar2,
ap out varchar2
is
begin
select count(*) into ap from tbuser where loginid = u and password = p;
end;
now at the front end side I have created one form with 2 text boxes (P8_USERNAME & P8_PASSWORD) and 2 buttons (Cancel and Submit)
as per you told me in the above post, I have created 'Validation' procedure with Type as 'Exists' and expression(into Validation Expression1)as:-
select 1 from tbuser
where loginid = :P8_USERNAME
and password = :P8_PASSWORD;
and
kept an error message as 'Invalid credentials'.....
but I don't know what's going wrong..... I do have few data into the table, and when I am entering the same data(with case sensitive) I am getting the Error message, rather than when the credentials are perfect user should be allowed to enter into the current page(where I have created this form and validation procedure)....
any idea what's going worng and where...????
thxs.... appreciated..
regards,
Kumar -
Hi all,
i have one internal table contains all records created in SD. but i need only records created for J_3avasso..
so i am comparing the first internal table (it_cdtemp1) records with values in j_3avasso and moving to another internal table (it_cdtemp2)
Please find the code for below.
select vbeln posnr etenr into corresponding fields of table it_cdtemp2
from j_3avasso for all entries in it_cdtemp1
where belnr = it_cdtemp1-vbeln and posnr = it_cdtemp1-posnr and
etenr = it_cdtemp1-etenr.
i could see the final internal table (it_cdtemp2) contains only 0 records.
please suggest a solution for this
Regards
BalaHi Bala,
Use CONVERSION_EXIT_ALPHA_INPUT FM for VBELN and convert all the entries of it_cdtemp1 with the leading zeros before the selection. Also make sure that there are entries in the table with the given selection criteria
Regards,
PSK -
How to track column level value change in oracle using procedures
I would need to write the below code using oracle stored procedures & packages.
DBA hates triggers so i cant enforce the same code.
Please help me out to achieve the same. thanks in advance.
if i do DML on master table (emp) , the audit should go to the emp_audit.i have used triggers but oracle DBA dont want to use triggers. Please guide me.
Master table : emp
column 1 : emp_id
column 2 : salary
create or replace TRIGGER test
AFTER INSERT OR UPDATE OR DELETE ON emp
FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:NEW.emp_id,
:NEW.salary,
:NEW.CREATED_TS,
:NEW.CREATED_user,
:NEW.MODIFIED_TS,
:NEW.MODIFIED_usER,
systimestamp, 'C'); -- INSERT
ELSIF UPDATING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:OLD.emp_id,
:OLD.salary,
:OLD.CREATED_TS,
:OLD.CREATED_user,
:OLD.MODIFIED_TS,
:OLD.MODIFIED_usER,
systimestamp, 'U'); -- UPDATE
ELSIF DELETING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:OLD.emp_id,
:OLD.salary,
:OLD.CREATED_TS,
:OLD.CREATED_user,
:OLD.MODIFIED_TS,
:OLD.MODIFIED_usER,
systimestamp, 'D'); -- DELETE
END IF;
END;
thanks,
balai am sorry.
we can't change master table emp structure.
Audit table would be emp_audit.
Please guide me to write some generic procedure to handle the audit , what ever insert/update/delete.
Please do the needful. thanks in advance.
Master table : emp
column 1 : emp_id
column 2 : salary
Audit Table : emp_audit
columns:
emp_id ,
salary,
created_ts,
CREATED_user,
MODIFIED_TS,
MODIFIED_usER,
archived_ts,
event_cd
create or replace TRIGGER test
AFTER INSERT OR UPDATE OR DELETE ON emp
FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:NEW.emp_id,
:NEW.salary,
:NEW.CREATED_TS,
:NEW.CREATED_user,
:NEW.MODIFIED_TS,
:NEW.MODIFIED_usER,
systimestamp, 'C'); -- INSERT
ELSIF UPDATING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:OLD.emp_id,
:OLD.salary,
:OLD.CREATED_TS,
:OLD.CREATED_user,
:OLD.MODIFIED_TS,
:OLD.MODIFIED_usER,
systimestamp, 'U'); -- UPDATE
ELSIF DELETING THEN
INSERT INTO emp_audit
(emp_id , salary,created_ts,CREATED_user,MODIFIED_TS,MODIFIED_usER, archived_ts, event_cd)
VALUES (
:OLD.emp_id,
:OLD.salary,
:OLD.CREATED_TS,
:OLD.CREATED_user,
:OLD.MODIFIED_TS,
:OLD.MODIFIED_usER,
systimestamp, 'D'); -- DELETE
END IF;
END;
thanks,
bala -
How to grant group level access to a dynamic page?
I'm trying to write some code which grants access to a Portal group on a dynamic page.
I've tried using the wwsec_api.set_group_acl procedure like this:
wwsec_api.set_group_acl(
p_group_id => 0, -- Authenticated User
p_object_type_name => wwsec_api.PORTLET_OBJ, -- ??????
p_owner => 'MYPROVIDER',
p_name => 'DYNAMIC_PAGE_NAME',
p_privilege => wwsec_api.MANAGE_PRIV
When I execute it I get an error message:
ORA-01722: invalid number
What object type is a Dynamic Page? Is PORTLET_OBJ correct?
Any suggestions are welcome!This worked for me:
wwsec_api.set_group_acl(
p_group_id => 0, -- Authenticated User
p_object_type_name => 'DYNAMIC',
p_owner => 'MYPROVIDER',
p_name => 'DYNAMIC_PAGE_NAME',
p_privilege => wwsec_api.MANAGE_PRIV
(Found the object_type_name in the table wwsec_sys_priv$) -
How to compare a boolean value returned from a function in a sql query
Hi all
i have a function which return boolean true or false.
mean while i am writing a sql query which should check this function and will return a result set only when it is true. how will i use a function which returns boolean in a sql query..
thanks in advance'
HariI don't think this is possible - i'm not sure. Can you post your function script? The reason why am i asking this is --
satyaki>set serveroutput on
satyaki>
satyaki>
satyaki>
satyaki>create or replace function test_satf(emno in number)
2 return boolean
3 is
4 v_cnt number(5);
5 v_flg boolean;
6 begin
7 select count(*)
8 into v_cnt
9 from emp
10 where empno = emno;
11
12 if v_cnt = 1 then
13 v_flg := TRUE;
14 else
15 v_flg := FALSE;
16 end if;
17
18 return v_flg;
19 exception
20 when others then
21 v_flg := FALSE;
22 return v_flg;
23 end;
24 /
Function created.
satyaki>
satyaki>
satyaki>
satyaki>
satyaki>
satyaki>desc emp;
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
satyaki>
satyaki>
satyaki>
satyaki>select count(*) from emp;
COUNT(*)
14
satyaki>
satyaki>select empno,test_satf(empno)
2 from emp;
select empno,test_satf(empno)
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
satyaki>select to_char(test_satf(empno))
2 from emp;
select to_char(test_satf(empno))
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
satyaki>
satyaki>create or replace function test_satf(emno in number)
2 return varchar2
3 is
4 v_cnt number(5);
5 v_flg varchar2(10);
6 begin
7 select count(*)
8 into v_cnt
9 from emp
10 where empno = emno;
11
12 if v_cnt = 1 then
13 v_flg := 'TRUE';
14 else
15 v_flg := 'FALSE';
16 end if;
17
18 return v_flg;
19 exception
20 when others then
21 v_flg := 'FALSE';
22 return v_flg;
23 end;
24 /
Function created.
satyaki>
satyaki>
satyaki>select test_satf(empno)
2 from emp;
TEST_SATF(EMPNO)
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TEST_SATF(EMPNO)
TRUE
TRUE
TRUE
14 rows selected.Or, may be i'm missing something.
Regards.
Satyaki De. -
How to compare 2 timestamp value (in terms of minutes)
Hi all.
I've got 2 timestamp value a,b. I would like to count the different (in terms of minutes).
I tried a.compareTo(b), but it's not work.
pls help.
Thanks
Regards,
KinI assume by "timestamp value" you mean Dates or longs.
Ever thought of basic maths?
date a - date b? Dates can be expressed in longs, as you might know.
For more info read the API. -
How to compare 2 string value?
i am creating a change password page, but having some problem,
i use this
if ( oldpassword == OrgPass)
out.println("correct pass");
else
out.println("incorrect pass");
both oldpassword and OrgPass are string, but even though the value of oldpassword and Orgpass are the same, it will still return a incorrect pass. Can anyone please help me with this?instead of this
if ( oldpassword == OrgPass)
out.println("correct pass");
try this
if ( oldpassword.equals(OrgPass))
out.println("correct pass"); -
How to compare, current value in :block.text_item with the database value
Hi
Could you please tell me
How to compare the current value in :block.text_item with the corresponding database column value.
I am using forms 10g
There is block and there is an text Item in that block.
When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
Now I add some value in the :block.text_item to the existing value.
now
the :block.text_item contains old+ new added value
whereas
the database table contains 'old' value
Now on a button click , I want to find out what is the value that I have added
Could you please tell me, is it possible without writing a select query?Hello,
Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
Value in Database is = ABCD
User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
DECLARE
vItemValue DATATYPE; -- Set the data type according to your desired field.
vValueAdded DATATYPE; -- Set the data type according to your desired field.
BEGIN
vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE); -- It will return you the database value in vItemValue variable.
IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN -- It mean something change or added
vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
MESSAGE('Added value is : '||vValueAdded); -- It will show you the added value.
END IF;
-- now suppose you want to show the old and new value in message not the added one
-- Then no need of IF condition. You can just use message like this
-- And i would prefer to use like this way
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
END;Hope it is clear.
-Ammad -
How to check the source value is in between a string range in mapping
Hi Consultants,
I am working on IDOC to File scenario. I need to implement a specific requirement of our client. i.e. something like below;
Vendor number can be any thing like 1AA000000 / 1AA000001/1AB000000/... ect till 1ZZ999999.
if the vendor number is in between 1AA000000 -1ZZ999999 then the target value should assign as 'Internal' else should assing as 'External'.
How to compare that the value of vendor is in between IAA000000 to 1ZZ999999 in mapping?
Appreciate your help.
Thanks in advance.
Regards,
NausheenYou can try creating an UDF and using the varName.substring(); method. Then you can compare in separated pieces the string. For example
String var = "1AA000000";
if (var.substring(3).compareTo("000000") < 0 && var.substring(3).compareTo("999999") > 0)
//compare now the "AA" and "ZZ" with the same logic;
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#substring(int, int)
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#compareTo(java.lang.Object)
EDIT: Moreover, those functions are available in the Mapping program creation, but this should give a clue on the order it should be done.
Edited by: Lucas Santos on Mar 29, 2011 7:38 PM
Edited by: Lucas Santos on Mar 29, 2011 7:53 PM -
<p>I have four groupings, Domain, Area, Priority (3rd level of grrouoping) and then Problem ID. Priority group could have values such as '1', '2', '3', '4' and '5' with corresponding "average" age formula on these group level. values.</p><p>Example: 1 Avg Age= 30</p><p> 2 Avg Age= 45</p><p> 3 Avg Age= 69</p><p>Reguirement: Display group name values and their corresponding average formula on a single line/row.</p><p>Sample Solution: Priority 1 = 30, Priority 2 = 45, Priority 3 = 69 </p><p> ***solution above should be displayed/concatenated on one line.</p><p>Your help is greatly appreciated, thank you in advance.</p>
So right now - your report looks like this
GroupHeader 1
GroupHeader 2
Priority 1 = 50 (actual display of Group 3)
Priority 2 = 75 (actual display of Group 3)
Priority 3 = 45 (actual display of Group 3)
Priority 4 = 9 (actual display of Group 3)
Priority 5 = 8 (actual display of Group 3)
And you want to change that so that it displays horizontally.
If there will only ever be 5 priorities, I think I would cheat the system a bit. Create a formula that runs at the group 3 level and dumps the values into 5 separate variables (formula below).
Then create 5 separate display formulas and put them in Group Footer 2 (if you already have a GF2 - then create a second one and move it above your current GF2). Suppress the G3 section and you should be close to what you are after (unless you also have detail sections, then we'll need to revisit).
This could also be accomplished with a multi-column subreport at the G2 or G3 level if you need more flexibility.
formula *******
numbervar priority1;
numbervar priority2;
numbervar priority3;
numbervar priority4;
numbervar priority5;
if {DB.Priority} = 1 then priority1:= {@avgGroupPriorityAvgAge}
else if {DB.Priority} = 2 then priority2:= {@avgGroupPriorityAvgAge}
else if {DB.Priority} = 3 then priority3:= {@avgGroupPriorityAvgAge}
else if {DB.Priority} = 4 then priority4:= {@avgGroupPriorityAvgAge}
else if {DB.Priority} = 5 then priority5:= {@avgGroupPriorityAvgAge} -
Comparing custom tags values to request parameters?
my question is how to compare a taglibrary value to jsp value ..is this even possible?
my code is as follows and in <!----> tags shows what I want to do...
basically I want to check if the sql column is equal to a request parameter... ANY HELP WILL BE GREATLY APPRECIATED SINCE I AM STUCK ON THIS FOR A WHILE NOW...
<%@ page import="java.io.*, java.sql.*, com.simpleneasy.*"%>
<%@ taglib uri="taglibdb.tld" prefix="sql" %>
<jsp:useBean id="sub" class="com.simpleneasy.SubPropertyBean"></jsp:useBean>
<jsp:useBean id="prop" class="com.simpleneasy.PropertyBean"></jsp:useBean>
<html>
<table>
<sql:openConnection driver=<%=getServletContext.getInitParameter("dbdriver")%> url="<%=getServletContext.getInitParameter("url")%>" user="<%=getServletContext.getInitParameter("user")%>" password="<%=getServletContext.getInitParameter("password")%>" id="db"/>
<% String str ="select * from " + prop.getTableName();
boolean edit = false;
if (request.getParameter("action").equalsIgnoreCase("edit"))
edit = false; %>
<form name="addedit">
<td>Property:</td>
<sql:setquery query="<%=str%>" res="sel"/>
<td><select name="propid">
<sql:forEachRow>
<% if (edit){%>
<!--over here i want check
if <sql:getColumn position="1" res="sel"> is equal to request.getParameter("propid") if it is then mark that option as selected...
-->
<option value="<sql:getColumn position="1" res="sel"/>"><sql:getColumn position="2" res="sel"/></option>
<% } else {%>
<option value="<sql:getColumn position="1" res="sel"/>"><sql:getColumn position="2" res="sel"/></option>
<%}%>
</sql:forEachRow>
</select></td>
more code continues...sorry for making it look like someone had replied, but I am experiencing exactly the same problem as you, I would appreciate if you could keep in touch and help me if possible whne and if u get the answer.
I tried this as example code
if (request.getParameter("param").compareTo("comparison"))
And find that my JSP has a null pointer exception......
Thanks my mail address is my user name here with hotmail, in addition at the end thanks
Maybe you are looking for
-
I am getting a "Fatal Error" when I am trying to install my HP LaserJet CP 1525nw color printer on my new wireless network (using the CD). Anybody have an idea how to fix this?
-
i hope someone may be able to help me as i am a total novice when it comes to anything tecky, i have just bought this phone because i was told i can put sat nav onto it? i have looked onto various forums and found that it is roadcom rc410 software i
-
Approver name for Purchase Order
Hi Expart I have to find out Purchase Req and corresponding Purchase Order that were approved by the same person. For that i need the table for approver for po or pq. Plz help me to get the approver name Thanks Raju
-
Notes sticking with KORG K61P MIDI Keyboard
Hey guys and gals: i finally got my KORG K61P MIDI Keyboard working in Garageband. Only thing is, a lot of times wheni play notes, they stick or hang. Now, i've noticed with some looking on other forums that people are having similar problems, but i
-
[SOLVED] Managing Kernels with rEFInd
Hey fellows hope you're all doing great. I just have some questions regarding refind boot manager which I use to dual boot arch and windows on my laptop. Before I installed arch,I installed refind boot manager from windows 8 using the guide on the r