Crystal reports, get sum for specific reocrds - asp.net

In Short:
I need to get a total for customer groups + the credits - the debits in a specific date range.
In Detail:
I'm creating an invoice report for customer orders. Each Customer belongs to a group, and I need to group the invoice by customer group so I can give a total amount owed for the customer group.
So the top Group in the report is customers.group_name with the total for the group in the group header.
The second group is orders.customer_id with the total for the customer in the group header.
I have 2 parameter for the date range of orders which I use in the select expert
I have another table for credits and debits for each group.
This are the fields for the CreditDebits Table
group_name
date_
type_ (this can be either "credit" or "debit")
amount
I've linked customers.group_name with CreditsDebits.group_name in the database expert.
I also use the date range parameters for this table
Do get the credits I created a formula called "credists" like so
if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount})
But when I drop this formula on the customers.group_name header, the formula shows up as empty and the total for the group gets messed up (it becomes triple of what it should be.
What am I doing wrong?

First check Does this field CreditsDebits.group_name consists of customer name? or any different name?
Place the formula if {Credits_Debits.type} = "credit" then sum({Credits_Debits.amount}) in footer but not in header and check.

Related

How to know what record I am in? Dynamics AX7

Here is the scenario:
In the Sales and marketing > Sales orders > All sales orders
I entered the lines by double-clicking the Sales order number
by doing that I am entering the lines of the sales order.
Now in my lines, there is a button there where I will use to add a syntax where I will insert fields in my newly created table.
I would like to know how can I know what record I am in (before entering the lines/before double-clicking the sales order number). I need to know what Sales order number I'm in as I enter the lines of the record.
In every form the current record of a specific FormDataSource has the same name of the FormDataSource. For example in the SalesTableListPage form the only datasource is called "SalesTable", so the current sales order record is identified in your code with the salesTable identifier.
Every record is extended from [Common]. There you have field TableId. You can get table name with [tableId2name].
You can inspect fields with DictTable and field* methods.

Find observations of an ID within a certain timeframe in the future in Tableau

I have a dataset in Tableau that contains sales data listing each sale the company has had in the past year. Each customer has a unique ID, and many customers return. I'm trying to figure out how to create a calculated field in Tableau that gives a True | False answer to whether a given patient ID appears again in the dataset within a given timeframe (say, within six weeks of a given observation).
I've tried running it with LOOKUP, but I haven't been able to specify the increase in time effectively.
This would be how I would approach it. Create two date parameters, start and end.
Then create a filter calc for the date.
[date] >= [param_date_start]
and
[date] <= [param_date_end]
Place this in the filter shelf set to TRUE.
Then create another parameter for your customer id and you can test for the existence of a customer id as follows.
max([customer_id] = [param_customer_id])
This will return true if there is at least one record where the customer_id equals the param_customer_id for the chosen dimensions and date range.
You could use this same approach to define a computed set, say the set of all products that were purchased by the customer in the specified date range, or the set of all patients that received a particular service. Just use this formula on the condition tab when defining the set.

Microsoft Access Report

I have 2 tables: Customer and Sales. The customer table has:
Customer Number
Customer Name
Customer Location
The sales table has:
Customer Number
Sales Date
Sales Amount
I created the relationship between the tables based on customer number. I can do a query that links up the data from each table.
What I have not been able to do is to summarize my Access report.
I only want Customer Number, Customer Name and Customer Location to show up once and I want each Sales Date and Sales Amount to show up associated with that customer.
Right now, when I do my report, Customer Number, Customer Name and Customer Location gets repeated for each sale.
For instance, if Customer A has 3 sales, Customer A shows up 3 times. I want Customer A to show up once, with the 3 sales listed individually underneath Customer A.
I can summarize it by Customer Number (using a group, I think), but Customer Name and Customer Location still show up multiple times.
I appreciate any advice.
You need to put all fields that you want to show up once in the group header.

Formula for conditional count of data with criteria in two different columns

My spreadsheet records every customer encounter and what employee they see the day of the visit. There are also two columns for whether they make a same day payment or make a payment on their account balance. I need a formula that will not only count how many customers an employee sees but only counts the customers that make same day payments.
Column B has the employee's initials listed in a drop down, so I will need the formula for each employee. Column F is the column for same day payments.
If it helps, each row collects an array of information: customer last and first name, phone number, employee who helped them, same day payment, balance on account payment, and payment method. I'm trying to count how many customers are coming in and making same day payments. I need to separate it by employee for commission reasons.
I have tried:
=COUNTIF('1'!B:B,"BK")
B is the column the employee names are in and BK is one of the employees. This formula is counting any rows with BK and what I want it to do is ONLY count the rows where a "same day" payment has been made (this is column F).
Assuming this is Excel, because you need an answer for a number of employees I strongly recommend a PivotTable, therefore with your columns labelled in Row1, Employee for ROWS and Count of "same day" for VALUES.
However if you prefer a formula, assuming ColumnF contains same day to indicate the same day payments an example for employee BK:
=COUNTIFS(B:B,"BK",F:F,"same day")
If you just need to count for all employees (so column B not blank) where there is a value in column F (greater than 0) you could just use:
=COUNTIFS($B:$B,"<>"&"",$F:$F,">"&0)
Or the following will count all cells in column F that arent blank:
=COUNTIF($F:$F,"<>"&"")

Access Report - Can't add a sum for a calculated currency column

I've generated a simple access report that is used for purchasing.
Basically, there are two tables, one for purchase orders, and one for the items on the purchase orders.
For the items on an order, I store the item details, quantity ordered, quantity delivered, and price per unit. (plus a few other fields which aren't relevant in the context of this question).
I'm generating a report to list all outstanding items still on order, and the report has a calculated field showing the outstanding quantity * cost per item. This works perfectly fine.
What I'm struggling with, is showing a sum of this calculated field (i.e. a total cost of all outstanding items), but when I try to add a total to the column, it only gives me the option of adding an item count for the column. The column is a 'Currency' field.
What might I be doing wrong, or am I expecting too much from access?
Resolved. I created the only option that the GUI would allow (item count), then modified the query from:
=Count(*)
to
=Sum([Quantity]*[Cost])
Works perfectly.

Resources