expression to Calculate percentage in ssrs - expression

What is the expression if I want to find the percentage of 50 of the total of
524?
Valid Consent
50
35
42
18
15
16
22
48
64
18
30
28
37
41
22
38

Assumeing that your data is in a table's field named CONSENT and using Dataset1, your table's detail expression could be
=Fields!CONSENT.Value / SUM(Fields!CONSENT.Value, "Dataset1")
This will take a single value from the CONSENT field in a table and divide it by the total of all CONSENT fields in Dataset1.

Related

Replicat Abended with ORA-02290: check constraint (TABLE_NAME.CHK_JSON) violated

We see the below in my Discard file -
NOTE: I can see the record in my source db.
CI Error ORA-02002: error while writing to audit trail
ORA-22275: invalid LOB locator specified
ORA-02290: check constraint (SCHEMA_NAME.CHK_JSON) violated (status = 2002), SQL <INSERT /*+ RESTRICT_ALL_REF_CONS */ INTO "SCHEMA_NAME"."TABLE_NAME" ("INSTRUMENTID","INDEXDETAIL","CREATIONTIME","LASTUPDATEDTIME") VALUES (:a0,EMPTY_CLOB(),:a2,:a3) RETURNING "INDEXDETAIL" INTO :dl0>
Aborting transaction on /local/dbms/oracle/goldengate_dbfs/oggma/goldengate_trails/oggma_deployment/var/lib/data/tc beginning at seqno 22 rba 206,136,818
error at seqno 22 rba 206136818
Problem replicating CATALOG_NAME.SCHEMA_NAME.TABLE_NAME to SCHEMA_NAME.TABLE_NAME.
Mapping problem with insert record (target format) SCN:12.1.6904...
*
INSTRUMENTID = 11111111
000000: 42 32 37 41 42 37 42 31 |11111111 |
INDEXDETAIL = (LOB)
CREATIONTIME = 2022-05-30 06:20:15
000000: 32 30 32 32 2d 30 35 2d 33 30 20 30 36 3a 32 30 |2022-05-30 06:20|
000010: 3a 31 35 |:15 |
LASTUPDATEDTIME = NULL
*
Process Abending : 2022-06-01 07:32:44.534819
May I know what type of Replicat you are using? Whether Audit is enabled? Also, could you please share the full GG version.
You can also refer to this KM note which might help you.
ORA-2002 And ORA-22275 Encountered When SELECT Audit Is Turned On For A Table (Doc ID 2764792.1)

removed rows containing NA values in a specific column Rstudio

I have a data contains 12 variables "columns" and 1200 rows. In 4th variable "column", many missing values "NA", so I want to remove all the rows that have NA value in the 4th column.
Note: the 4th column is: age : num 22 38 26 35 35 NA 54 2 27 14 ...
Assuming you are working with a data frame, you can try simply subsetting off the rows you don't want using the is.na() function. Something like this:
df <- df[!is.na(df[,4]), ]

Adding new column and inserting values to an exisitng excelsheet using SSIS/SSRS

I have an existing excel template as like below :
DATE 7/28/2016 7/29/2016 July MTD YTD
Call Activity
IB_Calls_Offered 22 29 52 52 52
IB_Calls_Answered 22 29 52 52 52
Sale 6 3 9 9 9
Everyday when my SP get executed , I need to add a extra column (as Current Date) and fill the corresponding data.
Kindly Suggest me how to do it by using SSIS/SSRS

After Sort in Python how to create new Index field

After I sort my data, I am trying to create a new index field.
Here is my code:
mydata_1=[[38,125,56],[98,23,150],[11,46,15],[23,87,81]]
cols= ['Col_A','Col_B','Col_C']
mydata_2= pd.DataFrame(mydata_1, columns=cols)
mydata_3= mydata_2.sort('Col_A')
So with my code above the output looks like this:
Col_A Col_B Col_C
2 11 46 15
3 23 87 81
0 38 125 56
1 98 23 150
I need to create a new column called "Col_D" as seen below:
Col_A Col_B Col_C Col_D
2 11 46 15 1
3 23 87 81 2
0 38 125 56 3
1 98 23 150 4
Also, I am going to be using this on many data sets. Is there a way to do this without specifying a range?
Here you go
import pandas as pd
mydata_1=[[38,125,56],[98,23,150],[11,46,15],[23,87,81]]
cols= ['Col_A','Col_B','Col_C']
mydata_2= pd.DataFrame(mydata_1, columns=cols)
mydata_3= mydata_2.sort('Col_A')
mydata_3["Col_D"] = range(len(mydata_3.index))
print(mydata_3)

Processing Timebased values

I have a list of timebased values in the following form:
20/Dec/2011:10:16:29 9
20/Dec/2011:10:16:30 13
20/Dec/2011:10:16:31 13
20/Dec/2011:10:16:32 9
20/Dec/2011:10:16:33 13
20/Dec/2011:10:16:34 14
20/Dec/2011:10:16:35 6
20/Dec/2011:10:16:36 7
20/Dec/2011:10:16:37 16
20/Dec/2011:10:16:38 5
20/Dec/2011:10:16:39 7
20/Dec/2011:10:16:40 15
20/Dec/2011:10:16:41 12
20/Dec/2011:10:16:42 13
20/Dec/2011:10:16:43 11
20/Dec/2011:10:16:44 6
20/Dec/2011:10:16:45 7
20/Dec/2011:10:16:46 9
20/Dec/2011:10:16:47 14
20/Dec/2011:10:16:49 6
20/Dec/2011:10:16:50 11
20/Dec/2011:10:16:51 15
20/Dec/2011:10:16:52 10
20/Dec/2011:10:16:53 16
20/Dec/2011:10:16:54 12
20/Dec/2011:10:16:55 8
The second column contains value against each second. Values are there for complete month and for each and every second. I want to add these values:
Per minute basis. [for 00 - 59 seconds ]
Per hour basis [ for 00 - 59 minutes ]
Per Day basis. [ for 0 - 24 hours ]
Sounds like a job for Excel and a pivot table.
The trick is to parse the text date/time you have into something Excel can work with; splitting it on the colon will do just that. Assuming the value you have is in cell A2, this formula will convert the text into a real date:
=DATEVALUE(LEFT(A2,SEARCH(":",A2)-1))+TIMEVALUE(RIGHT(A2,LEN(A2)-SEARCH(":",A2)))
Then just create Minute, Hour and Day columns where you subtract out that portion of the date. For example, if the date from the above formula is in C2, the following will subtract out the seconds and give you just up to the minute:
=C2-SECOND(C2)/24/60/60
Then repeat the process for the next two columns to give you the hour and the day:
=D2-MINUTE(D2)/24/60
=E2-HOUR(E2)/24
Then all you have to do is create a pivot table on the data with rows Day, Hour, Minute and value Sum(Value).

Resources