Number Count Beside Each Record?
How do you get a number count beside each record such as:
1. record 1 content
2. record 2 content
3. record 3 content
If they are coming from a query, the currentrow variable will
work.
Similar Messages
-
ODS - Number of Active Data Records count?
Hi,
I am having a ODS. In manage screen of ODS, i can able to see the records as shown bellow:
Transferred records: 352053
Added Records: 1836
But the number of entries in Active Data of ODS is only 471 records.
My question here is that why Added records (1836) are not equal to number of Active data records (471)? Where i am missing or is it correct?
Best Regards,
Venkata.Hi,
Have you completed the Activation of ODS data after uploading? If no see the entries in NEW records' table of ODS.
If you have activated already,still there is a chance to have different count, because of no of records with same value of KEY fields but exist in different packets.
With rgds,
Anil Kumar Sharma .P
Message was edited by:
Anil Kumar -
Count No of records in an internal table using 4 fields
Hi All,
I have an internal table with about 50,000 records. I need to group these (sort) based on 4 fields and then provide the count for each combination of the 4 fields.
For eg, if I have 3 records in the table which have the same values for all the 4 fields - say A,B,C,D, then the count is to be taken as 3 for that combination.
So my output will be
A B C D - COUNT -4 and so on.
I am looking for a efficient technique (good performance) to meet the above requirements given without too many loops. Please advise if you have a good method.
Thanks as always!
LizYou can use SORT and DELETE ADJACENT DUPLICATES FROM.
SORT itab by field1 field2 field3 field4.
DELETE ADJACENT DUPLICATES FROM itab COMPARING field1 field2 field3 field4.
you will be left with the unique combinations of the 4 fields.
LINES( itab ) will give you the number of records.
Thanks,
Sai Ramesh. -
Number of new delta records into cube
Hi,
The deltas are running for the cube. Client wants to know how many number of records are loaded in the cube for each load.
I mean when the delta load (process chain) completes it should send an email with number records loaded in to cube.
Please any one help me out on this issue. Thanks for your help in advance.
Thanks,
Raj.I have tried for 0MAT_PLANT as yours.You can see the record count as 67 records. I have tested this on BI 7.0 SP 16
.I got mine as follows:
Test mail
Process ZI_8SMATGMP2_full_Man Of Type Execute InfoPackage Has Status Successfully completed (Process Chain Temp) Log for This Process: Data successfully updated Diagnosis The request has been updated successfully. InfoSource : ZNK_OP_MAT_PLANT Data type : Transaction Data Source system: BW1110 Log of Respective Background Job: Job started Step 001 started (program RSPROCESS, variant &0000000048822, user ID BTC_GBL_BW) Data saved successfully Start InfoPackage ZPAK_43YOZD7INDYOXD6WA8VV2Z257 InfoPackage ZPAK_43YOZD7INDYOXD6WA8VV2Z257 created request REQU_49G2VHO86U1Q27NQC52VN7F8G InfoPackage ZPAK_43YOZD7INDYOXD6WA8VV2Z257 Started In Process Chain ZTEMP; Generated Request: REQU_49G2VHO86U1Q27NQC52VN7F8G Job finished Information for Process Master data table: 0MAT_PLANT Data Type (D- Trans.Data, H - Hier., M - Mast. Data, T-Text): D PSA Table: 8SMATGMP2_BA
Number of Data Records Received: 67 Number of selected data records: 67 Request Number: REQU_49G2VHO86U1Q27NQC52VN7F8G
Edited by: Manga Paidikondala on Apr 11, 2008 12:35 PM -
Number of times the record to be printed in Oracle reports
I have a requirement to print each record in specified number of times based on one of the field of
the record.
For Ex: Each record has the following fields and I need to print each record based on Quantity
Cust PO Number Item Number Quantity
PO1234 1P1 20
PO3456 1P2 15
I need to print the first record 20 times and second record 15 times.
Can you please suggest if we can set any parameter or printer option before each record to direct it to be printed in specified number of times?
Thanks,
RakeshWITH DATA AS (SELECT 'PO1234' CUST_PO_NUMBER, '1P1' ITEM_NUMBER, 20 QUANTITY FROM DUAL
UNION ALL
SELECT 'PO3456' CUST_PO_NUMBER, '1P2' ITEM_NUMBER, 15 QUANTITY FROM DUAL
COUNTER AS (SELECT LEVEL LVL FROM DUAL CONNECT BY LEVEL<1000)
SELECT * FROM DATA, COUNTER WHERE LVL<=QUANTITYreplace the first with-path (data) with your table -
Counting fact table records within brackets
Hi,
I have a star schema setup in OBIEE, consisting of a fact table of transaction records, linked to a customer dimension and a time dimension via PK-FK relations.
One of the requirements is to count the number of customers based on how many transactions they have done per time period. I imagine solving this by creating logical colums such as "# customers (1-10 transactions)", "# customers (11-20 transactions)", etc. The counting should be based on the current level of drill-down in the time dimension.
Any advice on how to approach this would be greatly appreciated
best regards
MThanks for you reply, it brought me a lot closer to a solution. So far i've been able to create a bracket attribute on the customer dimension (via Answers and then into Administrator, as advised). I've verified this against the database, and it categorizes each customer correctly.
The remaining challenge is that I want to see the count within each category on an aggregate bracket level rather than per customer. Using one attribute ("customer bracket") which can take on one of several values (e.g. "0", "1-10", "11-20", etc.) i'm not sure how to accomplish this.
As a workaround i tried creating one column in Answers for each bracket, taking on the value 1 for records falling within that bin, and 0 for all other records. Treating the column as numeric, and adding a sub total (sum), i get the answers i want for each bin. The problem here however, is that one line (value 0 or 1) is shown for each customer record, which makes the report useless for most practical intents and purposes as thousands of records are shown.
Any thoughts on which method i should go ahead with, and how?
regards
M -
Calculating the size of each record in a table?
Hi to all,
I trying to create histograms based on the unique record sizes in a particular table. However , in order to do that I need to calculate the size of each record in the table (in kilobytes preferably) and to get a list of unique record sizes.
Is there a function or easy way to calculate the size in Kbytes of a record in a table?
Thank you in advance!
TonyHi,
You can use the sum of the average of the vsizes of the fields in the table. For example:TEST.SQL>CREATE TABLE TEST
2 (
3 A VARCHAR2(50 CHAR),
4 B NUMBER
5 ) TABLESPACE TOOLS;
Table created.
TEST.SQL>INSERT INTO TEST VALUES('&1',&2);
Enter value for 1: A
Enter value for 2: 10
old 1: INSERT INTO TEST VALUES('&1',&2)
new 1: INSERT INTO TEST VALUES('A',10)
1 row created.
TEST.SQL>/
Enter value for 1: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Enter value for 2: 100000
old 1: INSERT INTO TEST VALUES('&1',&2)
new 1: INSERT INTO TEST VALUES('ABCDEFGHIJKLMNOPQRSTUVWXYZ',100000)
1 row created.
TEST.SQL>COMMIT;
Commit complete.
TEST.SQL>SELECT AVG(VSIZE(A)) + AVG(vSIZE(B)) FROM TEST;
AVG(VSIZE(A))+AVG(VSIZE(B))
15.5 The average line size - from the data in the table NOW - is 15.5 bytes.
HTH,
Yoann. -
How to genarate Primary Key for each record in XI Mapping
Hi,
I need to genarate primary key for each record in the paylod in mapping..
Eg: if i have a 10 reacords i need to have a primary key for each record..starting with the
Record Primary key
First 001
Secound 002
Tenth 010
If i need to write any user defined funtion... can any one provide the code for it.
Thanks
AmareshHi Bavesh,
I will explain with the example:
XML:
<Record 1>
<Primary key>
<value1>
<value2>
</Record 1>
<Record 2>
<Primary Key>
</Record 2>
like above i will be getting n number of recored and in each record i need to genarate primary key in XI.and the key sould be in sequence...
like for the first record 1 secound 2 like that primary key should add to the privous Primary key.
and this is for each payload.
Thanks
Amaresh -
SSRS 2008 R2 - Separate report for Each record?
Hi,
How do I create new pdf reports for each records from a table? The pdf files should be named as customerid.pdf and needs to be delivered in email or share path?
Each record has enough content for 5 page of pdf report.
How do we achieve this?
Thanks
RajYou can create a data driven subscription to loop through records in the table and create pdf based on number of customerid.
Have a look at this for DD subscriptions :
http://msdn.microsoft.com/en-us/library/ms169673.aspx
Kind Regards, Vikram Kansal Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker -
Hi everyone
I am new in crystal reporting and using Crystal Reports XI release 2. Firstly I should explain what I need to have. In my database I have got a parent table called Initiatives and a child table called benefits. One initiative has got many benefits associated with it and benefits are updated regularly by the users. Now my manager wants me to create an Initiative reports in such a way that all the initiatives are displayed and against each initiative there should be a box filled with either of these colour (red, yellow, green).
Let's say if Initiative "X" has got 10 benefits and if one or more benefits are outstanding by more than 2% then the colour of the box should be red. And if no benefit is outstanding by more than 2% and one or more benefits are outstanding more then 1% and less then 2% then colour of box should be yellow. And if no benefit is outstanding more than 1% then colour of box should be green.
Now for this I have created a report displaying all initiatives and a sub report with a SQL command containing the data from the benefits table. I have also included a database field which I would use as a box.
Now I want to loop through each record of the crystal report till the last record and format the field as per condition. I would probably use nested loop to look for the status of the benefits but I don't know how to do this in CR. In short I am looking to do this thing in CR
While Recordset.EOF
Do
But I can't find a key word for EOF or count-1 or some thing like that.
Seeking the help of you guys.
Regards,It would be much easier to simply let Crystal's conditional formatting do this for you.
Almost every formatting aspect of each object in Crystal can be controlled via expressions. Just click on the expression button to the right of the property...
ido -
Function to Generate a Sequential incremental Number by Group of Records
I have a table with several columns and I need to compute a sequential number by group of records
FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
AAAAAA A1 JOHN 01/01/61 NULL
AAAAAA A3 PAUL 01/01/71 NULL
AAAAAA A3 MARY 01/01/02 NULL
AAAAAA A4 CARL 01/01/04 NULL
BBBBBB A1 MARK 01/01/60 NULL
BBBBBB A2 ALLY 01/01/60 NULL
BBBBBB A5 JUAN 01/01/04 NULL
I need to compute FIELD5. This is defined as a number field.
Records where FIELD2 = A1 the default value for FIELD5 is zero.
I am grouping records by FIELD1, FIELD4
The value for FIELD5 will be assigned from 1 TO 1+N
For this sample, the resulting records will look like this;
FIELD1 FIELD2 FIELD3 FIELD4 FIELD5
AAAAAA A1 JOHN 01/01/61 0
AAAAAA A3 PAUL 01/01/71 1
AAAAAA A3 MARY 01/01/02 2
AAAAAA A4 CARL 01/01/04 3
BBBBBB A1 MARK 01/01/60 0
BBBBBB A2 ALLY 01/01/60 1
BBBBBB A5 JUAN 01/01/04 2
Question: Can I create a function that loops through the table and compute the value for FIELD5?I like this idea, but because F2 must always have the value of ZERO I decided to create a procedure to calculate the value for F5.
My procedure is below;
The issue I am having is that I am not sure;
1) When/where to set/reset the counter ?
2) Determine in the inner loop if I am still whithin the same group of records ?
3) When to update the new found value for MBR_MBR_DEP_CD field ?
CREATE OR REPLACE PROCEDURE LC_BUILD_DEP_CODE_PROC IS
V_ALT_ID VARCHAR2(30);
V_EMPLOYEE_SSN VARCHAR2(9);
--RELATIONSHIP_CD VARCHAR2(2);
--MBR_DOB DATE;
V_ALT_ID_2 VARCHAR2(30);
V_EMPLOYEE_SSN_2 VARCHAR2(9);
V_MBR_DEP_CD_2 NUMBER(2,0);
V_MBR_DEP_COUNTER INTEGER :=0;
/* FIRST CURSOR */
CURSOR GET_FAM_ALT_ID IS
SELECT FAM.ALT_ID,
FAM.EMPLOYEE_SSN
FROM TPA_MBR_STG FAM
WHERE FAM.RELATIONSHIP_CD = '18'
ORDER BY FAM.ALT_ID;
/* SECOND CURSOR */
CURSOR GET_MBR_DEP_CD IS
SELECT MBR.ALT_ID,
MBR.EMPLOYEE_SSN,
MBR.MBR_DOB,
MBR.MBR_DEP_CD
FROM TPA_MBR_STG MBR
--WHERE MBR.ALT_ID = V_ALT_ID
--AND MBR.EMPLOYEE_SSN = V_EMPLOYEE_SSN
WHERE MBR.RELATIONSHIP_CD <> '18'
ORDER BY MBR.ALT_ID, MBR.MBR_DOB;
BEGIN
-- OPEN FIRST CURSOR
OPEN GET_FAM_ALT_ID;
LOOP
FETCH GET_FAM_ALT_ID INTO V_ALT_ID,
V_EMPLOYEE_SSN;
OPEN GET_MBR_DEP_CD;
FETCH GET_MBR_DEP_CD INTO V_ALT_ID_2,
V_EMPLOYEE_SSN_2;
IF V_ALT_ID_2 = V_ALT_ID
AND V_EMPLOYEE_SSN_2 = V_EMPLOYEE_SSN
THEN
LOOP
V_MBR_DEP_COUNTER = V_MBR_DEP_COUNTER + 1;
UPDATE TPA_MBR_STG
SET MBR_MBR_DEP_CD = V_MBR_DEP_COUNTER;
END LOOP;
END IF;
CLOSE GET_MBR_DEP_CD;
V_MBR_DEP_COUNTER :=0;
END LOOP;
CLOSE GET_FAM_ALT_ID;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20001,'AN ERROR WAS ENCOUNTERED - '||SQLCODE||' -
ERROR- '||SQLERRM);
END LC_BUILD_DEP_CODE_PROC; -
Count Of each char in a String(Column)
Hi,
I have on column which stores any string.
I need count of each alphabet, repeated how many times.
For Ex:
If a column has value "ORACLE TECHNOLOGY",
O is repeated 2 times, R occurs 1 time, E is repeated 2 time etc.,
Please send the SQL Query for the above problem!!!
Thanks,
regards,
Suman Naidu.SOr..
http://forums.oracle.com/forums/thread.jspa?messageID=
1410941?Nice one Janeesh. I had to laugh though at the number of reponses who were giving PL/SQL answers whilst the OP kept on saying "No, I want a Query" meaning he wanted it just as SQL. Only one person gave a valid answer.
;) -
How to have a unique value for each record??
could any 1 help me out in this...
I want to have a column name 'Order No' which should be unique.
How to generate a unique value for each record.??could any 1 help me out in this...
I want to have a column name 'Order No' which should be unique.
How to generate a unique value for each record.?? If you are using SQL PLUS to create the table try something like
this:
CREATE TABLE ORDER_TEST (
ORD_NO NUMBER (8) NOT NULL PRIMARY KEY,
ORDERDATE DATE,
CUSTID NUMBER (8) NOT NULL,
SHIPDATE DATE,
TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
(TOTAL >= 0),
CONSTRAINT ORD_FOREIGN_KEY FOREIGN KEY (CUSTID) REFERENCES
CUSTOMER (CUSTID),
CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
-- or a simpler table example
DROP TABLE ORDER_TEST;
CREATE TABLE ORDER_TEST (
ORD_NO NUMBER (8),
ORDERDATE DATE,
CUSTID NUMBER (8) NOT NULL,
SHIPDATE DATE,
TOTAL NUMBER (8,2) CONSTRAINT TOTAL_ZERO CHECK
(TOTAL >= 0),
CONSTRAINT ORD_UNIQUE UNIQUE (ORD_NO)
note: ORD_NO can also be a primary key
If you are doing the INSERT during runtime from a form first
create a sequence in SQL PLUS to handle the ORD_NO value:
Create SEQUENCE ORDERNO_UNIQUEVAL_sqnc
START WITH 000001
NOMAXVALUE
NOCACHE;
and reference it as the ORD_NO parameter in your INSERT
statement:
ORDERNO_UNIQUEVAL_sqnc.NEXTVAL
note: to maintain data integrity you must use the sequence
everytime you insert a new order to table. To start a new
sequence drop the sequence and re-create it with whatever "START
WITH" value you want.
Hope this helps
Kevin -
Graphical mapping question - need to create 2 nodes for each record
The mapping is from flat to nested, i.e. flat file to FIDCC2 idoc. Each record has to go to 2 repeated IDoc segments, each one with different posting key. Right now, I have it working for each record to a segment(for one segment) by using splitByValue (value change). How can I repeat the creation of another but with slightly different constant.
Also, how do I add line numbers? I remember seeing a posting on this a while ago - cannot locate it.
Will be Rewarded WELL.
Thanks,
PamHi, Pam
Using the following example to store it as global variable
SetParameter from GloabalContainer:
container.getGlobalContainer ().setParameter ("COUNTER", "0");
GetParameter from GloabalContainer:
String myCounter = (String) container.getGlobalContainer().getParameter ("COUNTER");
When you map to your constant, store it in global variable, then you map other field, get current global variable, check its value, based on the value, you do proper mapping.
Hope it helps
Liang -
Calculate Days between same date field in multiple records, looping for each record
Be patient as I am a newbie to Sql Server (using 2008 R2) and SSIS. I have looked at multiple solutions in this and many other forums before submitting the question.
I am looking at records to identify the number of days between two dates. We review drug information. A member uses drug A (Code identifies this called GPI) and has refills throughout time. The goal is to calculate the days between Refill
1 and refill 2, then refill 2 to refill 3, etc. When that member record set is complete, we move to the next member record set.
The basic data would be as follows. Each record shown below would be a separate record in a single table :
Member
Drug Code
DateService
Days Between
1
A
3/1/2012
0
1
A
3/27/2012
27
1
A
4/21/2012
26
1
A
6/15/2012
56
1
F
2/25/2012
0
1
F
3/20/2012
25
1
F
4/17/2012
29
1
F
8/1/2012
107
5
B
2/15/2012
0
5
B
3/10/2012
25
5
B
4/10/2012
32
5
B
6/28/2012
80
5
B
7/10/2012
13
5
B
8/20/2012
42
The days between is the value I am looking to calculate. The First record for the grouping of Member and Drug Code will be zero ( 0 ) as there is no preceding date to calculate against. The process would then loop through the records at the grouping
(Member and Drug Code) until those records are calculated. It would then move on to the next group of Member/Drug records.
Any assistance would be greatly appreciated. Any clarification I can provide, I would be more than happpy too. Thank you in advance!TSQL- Finding the difference in days of multiple records in SQL ServerWITH OrderDates AS (
SELECT
ROW_NUMBER() OVER (ORDER BY OrderDate DESC) AS RowNumber,
OrderDate
FROM OrdersTable
WHERE SKU = 'AA0000'
SELECT
AVG(DATEDIFF(DD, O2.OrderDate, O1.OrderDate)) AS AverageFrequency
FROM OrderDates O1
LEFT JOIN OrderDates O2
ON O2.RowNumber = O1.RowNumber + 1
Fabio Bilicki
Maybe you are looking for
-
My computer has been restored i need the older itunes!
My computers been restored and it has done stuff to my songs. I have an ipod nano 6th gen and my laptop is a bit too old for this itunes! Is there a way to get the older version of itunes or is it long gone?? I would appreciate any help. Thanks!
-
Account Determination error while MIRO cancellation
Hi Masters While cancelling the invoice document in MR8M we get the following error Account Determination 1000 DIF not possible The transaction key DIF refers MM Small Differences. While posting the above MIRO document the users has given Rs. 7
-
How do I e-mail a web page I want someone else to see?
sometimes i see a web page I want to send onto someone...how do I do that now that you have changed things?
-
Cannot delete old sessions from SM35 - Batch Input...
Cannot delete old sessions from SM35 - Batch Input... We have an issue, we are trying to delete old batch input sessions via SM35 and no matter how hard we try we cannot get rid of them. They are still in status "In Process" but they
-
Strange Black Box around every prompt I am given...
This is very strange. I started up iChat for the first time on MBP and am now having a very strange occurance. At every prompt there is a strange black box around it. For example, right now there is a black box around the back arrow in my safari brow