average of particular filed in crystal reports - crystal-reports

i have a crystal report i want to find average of cntEcode value
so i try to add new formula field AverageEcode then i try to give code like that.
Average{DriverPerformance.CntEcode}
.but while saving showing error:
There is an Error with this formula.
Do you want to save any way.
how i can calculate average of particular field using formula filed. I attached picture what i try to do..how i can find out average of this values,If any one know.please help me to find out.
My

just give like this: sum({DriverPerformance.CntEcode}) / count({DriverPerformance.CntEcode})..then We Will get exact average value

Use a running total field to create the average. This will also give you the ability to average, sum, max, min, etc. by group. It will also give you the ability to add filters (if needed)

Related

Tableau creating a calculated percentage (non-aggregate) based on an aggregated total

Either I am the first person to ever need to display percentages in Tableau or I do not know what to search for! I highly suspect it is the latter...
I believe what I am attempting to ask is how to make a calculated non-aggregated field by dividing by an aggregated number. Although I would prefer just to be able to display the percentages instead of a whole number.
This is how I would do it in Excel:
The data that already exists is Column A and B. In Tableau these would be non-aggregated. What I need to do in Tableau is to generate what is column C (also non-aggregated) because it does not exist in my data. In excel, all I did to get the aggregate number (total) of column B was:
sum(B1:B4)
And for the column C:
=B1/$B$5
But I can't seem to do this at all in Tableau. When I try to use the same syntax, I get an error message: "Cannot mix aggregate and non-aggregate arguments with this function."
Instead of having a calculated field, you can use a Quick Table Calculation on the column.
Right-click the pill of your data > Quick Table Calculation > Percent of Total. This will show the percentages instead. If you want to keep both, just duplicate column b first and then add the table calculation to the new column.

How can I add an Average column to this text table?

I'm building my first dashboard in Tableau and I'm just beginning to learn all the nuances. Right now, I have a basic text table as shown in the image below. I'm trying to add an "Average" column at then end which will give the average per "Assignee" across the 5 fiscal week's shown. I assume there must be a pretty simple way to do this, but I've searched all over and cannot figure it out. I've been able to change the "Grand Total" column to show averages, but not add an additional column so I can display both data points. Can anyone provide some insight into how to make this work?
There are two things you can do:
Go To "Analysis/ Total/ Show Row Grand Totals" and the go to "Analysis/ Total/ Total All Using/ Average" This will give you the row and column averages. Your questions sounds like you want row average but column total, so you should try the second option.
Create a calculated field with WINDOW_AVG(sum([YourMeasure])) (Replace [YourMeasure] with the meassure you want to average. I couldn't see the full name in the screenshot) I will call it AverageMeasure
Then drag the AverageMeasure pill into the rows shelf, right click it and choose "Discrete".
It should look something like this now (I used the Tableau default data set):
If you want to format the number properly, right click on the AverageMeasure in the measures section, choose Default Properties/ Number Format and choose whatever you prefer.

Crystal Report: Get Minimum Date

I have this concern using Crystal Report which I am not really familiar with. Here's my scenario:
I have an existing report to update, I need to add a column (ETA) which has a datetime value. It may return more than one rows per Item No, I need to get the minimum date only per Item No from the result rows.
I already tried some solution mentioned here http://scn.sap.com/thread/1952829 but found no luck.
I used a suppression formula for the Details section of the report, but haven't succeeded yet.
IF {TableName.DateField} = Minimum({TableName.DateField}) THEN FALSE ELSE TRUE
Any possible things you can suggest me to try? Thanks in advance for this :)
good to get this value from sqlserver side. you just create a function which return a single data (minimum date).
If you wish in crystal report side, it is something you make loop of hundred for a single row display. You can use running total field for this.
Select the field , select summary type and put into the detail section.
or you can create a formula with group name option like
Minimum({TableName.DateField})
http://scn.sap.com/thread/1952829
http://businessintelligence.ittoolbox.com/groups/technical-functional/businessobjects-crystal-l/unable-to-filter-based-on-the-first-date-in-list-of-dates-4912881
please check
Running total field gives options for Min, Max, etc. but not Sum
http://flylib.com/books/en/4.229.1.28/1/

Sparkline based on Expression using custom code

I have an SSRS report which is reporting sales grouped by Month. One of the columns in this report is a calculated fields which takes 2 values and passes them to a custom code routine that is defined for this report. The textbox that is populated with the following code:
=Code.DivideBy(ReportItems!textbox21.Value, ReportItems!EarnedIncome1.Value)
All this Custom Code does is to divide the First Parameter by the Second Parameter (in this case whatever is in textbox21/EarnedIncome). The response is them shown on the screen as a percentage.
Below is an example of the report:
1 http://www.propelpos.com/images/screenshot002.jpg
This worked great. What we are trying to do now is to graphy the % that is in the BDX Loss ratio column which is figured out by the formula above (dividing Losses by Earned Premium)
When I try to copy the expression in the chart data and set the Category Groups to PeriodYearMonth (same as all the others), then I get a straight line.
I have no idea where to go next. Any ideas would be much appreciated.
I agree with #Neil. You can also Add the Calculated field in you data set properties. Take a look at the following screen. You can set the expression to calculate the data for your line chart.
Hope this helps!
I would suggest doing the calculation in your query and then using that computed column in SSRS. If you need help figuring out how to do that, let me know.

Crystal reports: using summary field in formula / summing time field in formula

In crystal reports I want to show the sum value of time objects, i.e. An employee worked in one month three days and on each day a variable amount of hours.
Is there anyway to sum a time field?
Or as a workaround I could use the time field as an integer, sum this and display. But then I would like to change the display format by using a formula. I cant find a way to include summary fields in a formula...
Thanks in advance
PS I am using CR 2011 (just the program not through VB or anything).
You cannot sum a date/time field. You will have to use datediff("n",{datetime1},{datetime2}) to get a time interval between two date/time fields in minutes.
To use a summary function in a formula, you can use this sum({#YourMinutesFormula},{FieldYouAreGroupingOn})
You may omit the second parameter if you want the summation over the entire report instead of a grouping level. Check the Crystal Reports help file for more details on Sum().