Suppressing duplicates for summing
Post Author: srikarthy
CA Forum: General
Order
Amount
Item
quantity
ATR-PSU1
1211.93
PR0000460
583.14
PR0000460
291.57
ATR-PSU1
1.00
PR0000460
0.00
ATR-PSU1
1.00
PR0000460
0.00
ATR-PSU1
1.00
PR0000460
13.60
ATR-PSU1
1.00
PR0000460
277.97
ATR-PSU1
1.00
PR0000750
628.79
PR0000750
314.39
ATR-PSU1
3.00
PR0000750
0.00
ATR-PSU1
3.00
PR0000750
0.00
ATR-PSU1
3.00
PR0000750
27.20
ATR-PSU1
3.00
PR0000750
287.19
ATR-PSU1
3.00
Good Day!
In the report above, each production order has various costs like material costs, operations cost hence there are many lines for a production order. But the quantity is just 1 and 3 in the two production orders above. How to total the quantity by item? When I sum it, it shows 20 instead of 4.
Thanks,
srikarthy
Post Author: synapsevampire
CA Forum: General
Assuming you're already grouped by whatever entity you are trying to show the sum for, add a group by the order (you can suppress it if need be) and use the 3 formula method:
ATR-PSU1 group header formula:whileprintingrecords;numbervar MySum:=0
Order Group Header formula:whileprintingrecords;numbervar MySum:=MySum+{table.quantity}
ATR-PSU1 group footer formula (displays the sum here):whileprintingrecords;numbervar MySum
-k
Similar Messages
-
Looking for alternative formulas to suppress duplicates through Section Expert
I'm using version 14.0.2.364 CR and having trouble building a customized treatment plan report for our case workers to manage to filter out duplicates. I'll do my best to give a layout and criteria:
GH: CDCLIENT.SAI_ID STAFF.SORT_NAME
Case #
First Name
Last Name
Home Phone
DOB
Tx Plan Start Date
Tx Plan End Date
CDCLIENT.CASE_NUM
CDCLIENT.FIRST_NAME
CDCLIENT.LAST_NAME
CDCLIENT.PHONE
CDCLIENT.DOB
PLAN.BEG_DATE
PLAN.END_DATE
GF: CDCLIENT.SAI_ID STAFF.SORT_NAME
The problem is that when pulling data for each client, it will bring forward all their tx plans, but I just want to show the newest one. I was inclined to go to section expert > Select Details > Suppress (No Drill down) and in X-2, put the following:
if {CDCLIENT.CASE_NUM} = next({CDCLIENT.CASE_NUM}) then true else false
This will suppress duplicate records ONLY if I have this sorted by Case #. The problem is, we want to sort by Tx Plan End Date, so case workers can identify which clients are coming up for expiring tx plans. The way the data is stored, I have the first 5 columns from one table, and the last two in another. I also tried to format the field, go to "Commons" on CASE_NUM and choose Suppress (if Duplicated) in combination with the Section Expert, but it was still pulling both if I have it the sort order start at PLAN.END_DATE.
Is there a way to preserve the most recent begin / end date and suppress any duplicates without sorting it by case #?Jamie Wiseman wrote:
or in the case of your report use this as the suppression formula...sorry again about the original code.
{AZCLPLAN.BEG_DATE} <> maximum ({AZCLPLAN.BEG_DATE}, {CDCLIENT.SAI_ID})
The problem with this suppression is that for each Case Worker (Group) it is only pulling one client record forward, thus suppressing all other multiple unique clients associated with this caseworker.
What my original report (before your suggestions is this):
Case Manager Name (group CDCLIENT.SAI_ID)
CDCLIENT.CASE_NUM
CDCLIENT.FIRST_NAME
CDCLIENT.LAST_NAME
CDCLIENT.PHONE
CDCLIENT.DOB
PLAN.BEG_DATE
PLAN.END_DATE
1
Client A
Client A
111-111-1111
01/01/11
01/01/2013
01/01/2014
2
Client B
Client B
222-222-2222
02/22/22
02/02/2013
02/02/2014
3
Client C
Client C
333-333-3333
03/31/33
03/03/2013
03/03/2014
1
Client A
Client A
111-111-1111
01/01/11
01/01/2014
01/01/2015
4
Client D
Client D
444-444-4444
04/04/44
04/04/2014
04/04/2015
Notice, it finds two records for Client A, because they are an existing client that needs continuous treatment. The caseworker doesn't need to see the older record for Client A, but also needs to see all other unique records.
I basically want it to suppress the first row (older treatment plan) for Client A and have it display like this in conjunction with all other unique clients:
Case Manager Name (group CDCLIENT.SAI_ID)
CLIENT.CASE_NUM
CDCLIENT.FIRST_NAME
CDCLIENT.LAST_NAME
CDCLIENT.PHONE
CDCLIENT.DOB
PLAN.BEG_DATE
PLAN.END_DATE
2
Client B
Client B
222-222-2222
02/22/22
02/02/2013
02/02/2014
3
Client C
Client C
333-333-3333
03/31/33
03/03/2013
03/03/2014
1
Client A
Client A
111-111-1111
01/01/11
01/01/2014
01/01/2015
4
Client D
Client D
444-444-4444
04/04/44
04/04/2014
04/04/2015
What your Section Expert + Summary Code did, was essentially this:
Case Manager Name (group CDCLIENT.SAI_ID)
CLIENT.CASE_NUM
CDCLIENT.FIRST_NAME
CDCLIENT.LAST_NAME
CDCLIENT.PHONE
CDCLIENT.DOB
PLAN.BEG_DATE
PLAN.END_DATE
4
Client D
Client D
444-444-4444
04/04/44
04/04/2014
04/04/2015
Maximum
04/04/2015
Let me know if this is possible. -
How to suppress duplicate records in rtf templates
Hi All,
I am facing issue with payment reason comments in check template.
we are displaying payment reason comments. Now the issue is while making batch payment we are getting multiple payment reason comments from multiple invoices with the same name and it doesn't looks good. You can see payment reason comments under tail number text field in the template.
If you provide any xml syntax to suppress duplicate records for showing distinct payment reason comments.
Attached screen shot, template and xml file for your reference.
Thanks,
Sagar.I have CRXI, so the instructions are for this release
you can create a formula, I called it cust_Matches
if = previous () then 'true' else 'false'
IN your GH2 section, right click the field, select format field, select the common tab (far left at the top)
Select the x/2 to the right of Supress in the formula field type in
{@Cust_Matches} = 'true'
Now every time the {@Cust_Matches} is true, the CustID should be supressed,
do the same with the other fields you wish to hide. Ie Address, City, etc. -
Need help-SQL with result format suppressing duplicate values
I am trying to write a SQL which would select data from the below tables(in reality i have many other tables also) but I wanted to know how do i get the data in the format given below.
The scenario is :-A training_plan can N no. of OBJECTIVES and EACH objective has N no.of activities
Insert into TEST_TRAINING_PLAN
(TPLAN_ID, TPLAN_NAME, TPLAN_DESC, T_PERSON_ID
Values
('111', 'test_name', 'test_name_desc', '****')
Objectives table:-
Insert into TEST_TRAINING_OBJECTIVE
(T_OBJECTIVE_ID, T_OBJECTIVE_NAME,T_owner)
Values
('10', 'objective1', '1862188559')
Objective and Training Plan relationship table where TPLAN_ID is the foreign key.
Insert into TEST_TP_OBJECTIVE
(TPLAN_TOBJ_ID, TPLAN_ID, T_OBJECTIVE_ID,
REQUIRED_CREDITS)
Values
('1', '111', '10',5)
Objective and Activity relationship table where T_OBJECTIVE_ID is the foreign key from the TEST_TRAINING_OBJECTIVE table.
Insert into TEST_TRAIN_OBJ_ACTIVITY
(TOBJ_TRAIN_ACTIVITY, T_OBJECTIVE_ID, ACTIVITY_ID, IS_REQUIRED, STATUS,
ACTIVITY_TYPE, ITEM_ORDER, IS_PREFERRED)
Values
('1000', '10', 'selfstudy event', SS1, NULL,
'Event', 0, 0);
Insert into TEST_TRAIN_OBJ_ACTIVITY
(TOBJ_TRAIN_ACTIVITY, T_OBJECTIVE_ID, ACTIVITY_ID, IS_REQUIRED, STATUS,
ACTIVITY_TYPE, ITEM_ORDER, IS_PREFERRED)
Values
('1001', '10', 'SQLcourse', 1, NULL,
'Course', 1, 0);
Insert into TEST_TRAIN_OBJ_ACTIVITY
(TOBJ_TRAIN_ACTIVITY, T_OBJECTIVE_ID, ACTIVITY_ID, IS_REQUIRED, STATUS,
ACTIVITY_TYPE, ITEM_ORDER, IS_PREFERRED)
Values
('1002', '10', 'testSQL', 1, NULL,
'test', 2, 0);
COMMIT;
firstname emplid Tplan name Number of activities/credits completed(for TP) Objective Name Number of required activities/Credits (for objective) Number of activities/credits completed(for objective) activity name activity completion status
U1 U1 TP1 5
OBJ1 4 3 C1 PASSED
C2 PASSED
C3 WAIVED
T1 ENROLLED
T2 ENROLLED
OBJ2 3 2
S1 ENROLLED
S2 PASSED
T3 WAIVED
U1 U1 TP2 C4 INPROGRESS
50 OBJ11 50 30 C11 PASSED
**The second row where we have another training_plan record and accordingly all objectivesand their objective.**similarly ,i need to display many Training_plan records in such tabular format.Please help with the SQL query to select and display data in the above format
If you want to suppress duplicate values in some of your results columns
I am using toad 9.1 using Oracle 10g version 2Hi,
You can use the BREAK command to suppress duplicate values.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12009.htm#SQPUG030
(scroll down for an example)
It's a 'SQL*Plus-ism', not sure if TOAD's capable to handle it.
Simple example:
HR%xe> break on department_name
HR%xe> select l.department_name
2 , e.last_name
3 , e.first_name
4 from departments l
5 , employees e
6 where e.department_id = l.department_id;
DEPARTMENT_NAME LAST_NAME FIRST_NAME
Executive King Steven
Kochhar Neena
De Haan Lex
IT Hunold Alexander
Ernst Bruce
Austin David
Pataballa Valli
Lorentz Diana
Finance Greenberg Nancy
Faviet Daniel
Chen John
Sciarra Ismael
Urman Jose Manuel
Popp Luis
Purchasing Raphaely Den
Khoo Alexander
Baida Shelli
Tobias Sigal
Himuro Guy
Colmenares Karen
Shipping Weiss Matthew
Fripp Adam
Kaufling Payam
Vollman Shanta
Mourgos Kevin
Nayer Julia
Mikkilineni Irene
Landry James
Public Relations Baer Hermann
Accounting Higgins Shelley
Gietz William
106 rijen zijn geselecteerd. -
Suppress duplicate notifications if member and manager in assignment group are same
Hello All,
We are currently using out of the box notification mechanism in HPSM 9.32. I have added few notifcations for SD, IM, CM and PM Modules.
I would like to know if there is a way to suppress duplicate email notification being sent to the same person if he/she is of the member as well as manager or coordinator of the same group.
Currently HPSM is sending 2 emails notifications to the same person one which configured to be sent to the manager of the group and another to the assignment group. Hence, manager is also one of the member in the assignment then he is getting 2 email notifications.
I need your assistance in suppressing such duplicate email notifications.
Regards,
NSEILI have CRXI, so the instructions are for this release
you can create a formula, I called it cust_Matches
if = previous () then 'true' else 'false'
IN your GH2 section, right click the field, select format field, select the common tab (far left at the top)
Select the x/2 to the right of Supress in the formula field type in
{@Cust_Matches} = 'true'
Now every time the {@Cust_Matches} is true, the CustID should be supressed,
do the same with the other fields you wish to hide. Ie Address, City, etc. -
hey iphone an iphone 3g and i only have about 13 apps and the yellow bar on itunes for my phone is way to big i deleted all my photos all my music every thing i ryed restoring ans all it still takes up space for sum reason ?? please someone help me
If Other (the yellow bar) is too big something is corrupted. The only solution (that I know of) is to restore from your most recent backup using iTunes (see http://support.apple.com/kb/ht1766).
-
Suppress Duplicates That Aren't Exactly Duplicates
I'm using the following query command in a report:
SELECT DISTINCT
TOP (100) PERCENT U.USER_NAME, A.NAME, S.SAMPLE_NUMBER, V.VERSION
FROM dbo.TEST AS T INNER JOIN
dbo.SAMPLE AS S ON T.SAMPLE_NUMBER = S.SAMPLE_NUMBER INNER JOIN
dbo.ANALYSIS AS A ON T.ANALYSIS = A.NAME INNER JOIN
dbo.LIMS_USERS AS U ON A.KEY_CONTACT = U.USER_NAME INNER JOIN
dbo.VERSIONS AS V ON A.VERSION = V.VERSION
WHERE (S.STATUS = 'U') AND (S.LOGIN_DATE BETWEEN CONVERT(datetime, CONVERT(varchar, DATEADD(day, - 100, GETDATE()), 101), 101) AND
CONVERT(datetime, CONVERT(varchar, DATEADD(day, 0, GETDATE()), 101), 101))
ORDER BY U.USER_NAME, A.NAME, S.SAMPLE_NUMBER, V.VERSION DESC
Basically, my output is something like this:
John pH 12365 2
John pH 10020 2
Sally pH 12365 1
Sally pH 10020 1
Sue Turb 56479 3
Sue Turb 56479 2
Sue Turb 56479 1
I don't want the report to show the rows with a pH analysis of an old method version. Thus, only John's records should show up and not Sally's. And I don't want Sue's last two records to show up, since version 3 is the highest.
Maybe there's a way to modify the query command to only show records for the highest version of a method, but I'm not sure how to do that. Or maybe there's a way to suppress the lower version analyses in Crystal.
Any ideas?you can do this by:
1) create a group on the name
2) put a summary on the version for Minimum for the entire report
3) put a summary on the version for Maximum for the name group
4) create a suppression formula for the details section using something similar to
= Minimum() or
< Maximum(, namegroup)
Edited by: Jamie Wiseman on Dec 31, 2009 3:57 PM -
Built in SQL Function for Sum of Geometric Progression
Hi all,
Please let me know if there is any availble built in SQL function for
SUm of Geometric Progression.
Thanks in Advance,
Kaushik B.and also relatively simple to write:
s = a*(1-power(r,n+1))/(1-r)
assuming you have a row with values of a,r and n (and that's the sum you need)
Jon -
Suppressing totals for individual columns
In OBIEE 10.1.3.4 Answers, is there a way to suppress totaling for an individual column? I have a derived column - unit price - that I want to suppress totaling on, while retaining totals for quantity and amount. I can do it by casting the column to character, but figured there must be a better way.
Never mind... foundit!
Edited by: andrea.bender on Jul 14, 2011 6:42 AMTo suppress totaling on a specific column, go into the report and edit the formula for column and set Aggregation Rule to 'None'
-
Open table/index node yields duplicates for partitioned objects
The generated query for this operation (extracted from the log) is:
select distinct t.table_name, t.num_rows, ao.status,
+(select count(*) from sys.Dba_tab_columns c where t.table_name = c.table_name and t.owner = c.owner) columns,+
+(select comments from sys.Dba_tab_comments c where t.table_name = c.table_name and t.owner = c.owner) comments,+
+(select count(*) from sys.Dba_indexes i where t.table_name = i.table_name and t.owner = i.table_owner) indexed_columns,+
t.avg_row_len,
t.tablespace_name,
t.avg_row_len * t.num_rows estimated_size,
ao.last_ddl_time,
ao.created,
+(select count(*) from sys.Dba_dependencies where REFERENCED_OWNER = t.owner and REFERENCED_NAME = t.table_name) referenced_objects,+
+(select count(*) from sys.Dba_triggers r where r.table_owner = t.owner and r.table_name = t.table_name) trigs+
from sys.Dba_tables t,sys.Dba_objects ao
where ao.owner = :OBJECT_OWNER
and ao.owner = t.owner and ao.object_name = t.table_name
and aO.GENERATED = 'N'
AND aO.OBJECT_NAME NOT IN (SELECT OBJECT_NAME FROM RECYCLEBIN)
AND aO.OBJECT_NAME NOT IN (SELECT MVIEW_NAME FROM SYS.Dba_MVIEWS WHERE :OBJECT_OWNER = OWNER)
AND aO.OBJECT_NAME NOT IN (SELECT QUEUE_TABLE from Dba_queue_tables WHERE :OBJECT_OWNER = OWNER)
AND not ( ao.object_name like 'AQ$_%_G'
or ao.object_name like 'AQ$_%_H'
or ao.object_name like 'AQ$_%_I'
or ao.object_name like 'AQ$_%_S'
or ao.object_name like 'AQ$_%_T' )
AND ( user = :OBJECT_OWNER or not ao.object_name like 'BIN$%' ) -- user != :SCHEMA --> object_name not like 'BIN$%'
-- RECYCLEBIN is USER_RECYCLEBIN!
order by 1
Trouble is that joining dba_tables to dba_objects produces duplicates for partitioned tables.
The same is true for the index node.
Should I file a bug, or is it already picked up ?
Cheers,
Olivier.No answer after 8 days -> Reactivation.
Tx.
Olivier. -
Operand data type char is invalid for sum operator
can someone help me re-writing the following so I wont keep getting thie baopv ementioned error: here is the statement:
RIGHT('0000000000'+REPLACE(CAST(SUM(PAID_AMT) AS VARCHAR),'.',''),14) AS TOT_NET_PAID
+
RIGHT('0000000000'+REPLACE(CAST(SUM(PAID_AMT)
AS
VARCHAR),'.',''),14)
AS TOT_NET_PAID
It keeps retuning he following error messages:
Operand data type char is invalid for sum operatorAs Jingyang said, you cannot sum a non numeric field. Cast it to a numeric first (INT maybe?)
+ RIGHT('0000000000'+REPLACE(CAST(SUM(CAST(PAID_AMT AS INT)) AS VARCHAR),'.',''),14) AS TOT_NET_PAID
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. -
Display Duplicates for podcasts
iTunes 10.1.2: Is there a way to have "Display Duplicates" for podcasts? It only seems to apply to Music.
Can't say I've ever noticed this one, but it probably falls under the "It's not a fault, it's a feature!" category.
Workaround:
Create a Smart Playlist with the rule Media Kind is Podcasts. Display duplicates will work for you there...
tt2 -
There are duplicates for all of my contacts showing up on both iPads and in iCloud. Why and how can I fix that? Thanks.
Firstly, may I ask you about your operating system, your profile states that you are using 10.6.8, lion and therefore iCloud will not work with 10.6.8.
Assuming you are using lion:
One reason you may have duplicates is that you have each contact listed under your 'iCloud' account AND under your 'on my mac' account. Only contacts in the iCloud account will sync.
Click on the ribbon in the Address Book to reveal 'Users & Groups', and then by selecting each account on the left side you will see which contacts are in which account. (make sure nothing is typed in the search field)
If this is the reason you have duplicates you have two options of dealing with the situation. Either you can leave the duplicates alone and click on one account or the other before clicking on the ribbon again to limit what you see to that account when you return to the main part of your Address Book.
Or you can delete all the contacts from one account (usually the 'on my mac' account if you want to continue syncing with iCloud). Click on the account you want to delete contacts from on the left side of the Address Book and select the first contact in the list on the right, shift click the last contact to select all and delete.
Finally, You may want to check your default account is set correctly in the Address Book preferences.
This user tip might help you understand how accounts work with Address Book. -
Hi, does anyone know of any free software like Gemini that i can use to clean up my duplicates for Mac OS X Version 10.6.8?
Duplicate what? Documents? Photos? Music? Something else? If you're talking photos or music are these managed by iPhoto, Aperture, Lightroom or similar?
-
Suppress Confirm for Move-MailboxDatabase
Exchange 2013 CU6
I need to change the log file location for 70 DBs. I have a Powershell command to do so, however I keep getting prompted for the Confirmation. I can't suppress it for my command, nor just a simple one DB command.
This is what I am running:
Move-DatabasePath -Identity MDB37 -LogFolderPath m:\databases\mailbox\MDB37 -ConfigurationOnly -Confirm:$False
This is what I get:
Confirm
This operation will skip the safety check and make the change to Active Directory directly. Do you want to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): n
Am I missing something? This seems like something that should be easy.....it hasn't been so far.Lynn is right, Confirm parameter suppresses any acknowledgement that is required while Force parameter suppresses any Administrative inputs that are required (eg. make the AD change, dismount the database etc...)
Also make sure that you mount the database after this, as moving log path will dismount the DB...
Amit Tank | Exchange - MVP | Blog:
exchangeshare.wordpress.com
Maybe you are looking for
-
Why do I get Colored bands on some images in LR4 and LR5, but not in Aperture?
On some images -- both RAW and JPG -- when opened in LR4 or LR5, there will be one or two "curved" color abberation lines across the entire image. This doesn't occur when I open the images in Aperture. Any idea why? Thanks
-
HT5706 Connect to apple tv thought laptop
Can't don't open page to home sharing iTunes thought iPhone or iPod iPad
-
Hi, The Group and Legal costs that are sent to BW from R/3 contain as 6 decimal places. As cost fields, the Group and Legal Costs are stored in BW as currencies and therefore have only 2 decimal places. The two objects are going to need to be change
-
Does media sync for mac not work?
Hello, I have repeatedly downloaded media sync, and I cannot transfer pictures off of my girlfriend's 8530 curve? Anyone else experience this? If so, how did you get around it? Since all the documentation is for the PC, I'm thinking RIM is trying to
-
How can I determine whether my Exchange 2007 32-bit or 64-bit
I want to apply SP1 and would like to know which is the correct SP1 for me. thanks in advance. Omar Nawaz