I want to sum the total amount of a field(it has to lines in sql so value should be 44+250=294) which belongs to a group but it peaks only the first line(44).
For example below is the formula that i have created.
if Sum({STOCK.QTYSTU_0},{#pickGrp3}) -Sum ({STOALL.QTYSTUACT_0}, {#pickGrp3}) = 0 then "EMPTY" else " "
Can you please advise?
Related
I have a report with a list of orders and their product lines
the order lines have Qty ordered, Qty Delivered and Qty Backordered.
the Group header is the Sales Order number, the Details are all the product lines on that sales order.
I want to calculate in the Report footer the count of all Sales orders that have a backorder on them only.
I can do "if sum of backorder <> 0 then 1 else 0" in Group footer, but i cannot sum the result of this, i get "This field cannot be summarized" because you cannot sum a sum.
is there another way i can achieve this?
for example:(report sample)
this example should be 1 in the report footer because only one of the orders has a backorder.
thanks
Create a new formula with following content and name it #SalesWithBackOrder (The formula doesn't need to be placed anywhere on the report):
If {backorder} <> 0 Then
{SalesOrderNumber}
Else
0
or if {SalesOrderNumber} is text then:
If {backorder} <> 0 Then
{SalesOrderNumber}
Else
""
Then count the number of distinct values of the #SalesWithBackOrder formula.
You can do this by creating a new formula with following content (put it in your report-footer):
DistinctCount ({#SalesWithBackOrder})-1 // -1 because order-number "0" respectively "" is a distinct value too.
I am using Crystal Reports 2008 and cannot figure out the proper expression for suppressing fields.
In this case, say I have a pill diary.
{PILL.TYPE_ANTI_INFLAMMATORY}
{PILL.TYPE_PAIN_REDUCTION}
{#INTEGER_TYPE1}
{#INTEGER_TYPE2}
The first two elements from the data tables PILL are columns of pill types. The first one is a column of type of anti-inflammatory pills, the second pain reduction. These columns each contain unique information.
In the second two elements, is a column of integers either negative or positive. These are formula columns (date difference between two dates.)
My expression:
{PILL.TYPE_ANTI_INFLAMMATORY} = "Advil" or
{PILL.TYPE_PAIN_REDUCTION} in ["Tylenol", "Acetometaphin"] and
{#INTEGER_TYPE1} > 1 or
{#INTEGER_TYPE2} > 1
What I am trying to do is display any row in which ANTI_INFLAMMATORY is equal to Advil or PAIN_REDUCTION is equal to Tylenol or Acetometaphin while also one of the columns of integer type is greater than 1.
(
{PILL.TYPE_ANTI_INFLAMMATORY}="Advil" or
{PILL.TYPE_PAIN_REDUCTION} IN ["Tylenol","Acetometaphin"]
) and
(
{#INTEGER_TYPE1} > 1 or
{#INTEGER_TYPE2} > 1
)
IF ({PILL.TYPE_ANTI_INFLAMMATORY}="Advil" or {PILL.TYPE_PAIN_REDUCTION} IN ["Tylenol","Acetometaphin"])
AND
({#INTEGER_TYPE1} > 1 or {#INTEGER_TYPE2} > 1) THEN
FALSE ELSE TRUE
I'vre created a cross tab report with 2 calculated Member to be able to have the difference between 2 column and the percentage of this difference in CR 2011. What I want to achieve is to create a new column that will display a test depending on the difference value.
Here is a example:
Col1 Col2 Difference Percentage Action
200 0 -200 100 DROPPED
100 100 0 0
0 300 300 100 ADDED
How can create this action column. Calculated member only want some amount value so I cannot output a text in the formula.
Thanks in advance for your help
I finally found the solution.
I can use the Display string formula in the Format Field properties (Common Tab). Here I just check the column and return the string I want otherwise I just format the number.
IF GetColumnGroupIndexOf(CurrentColumnIndex) = 1
AND CurrentColumnIndex =4 THEN
IF GridValueAt(CurrentRowIndex, CurrentColumnIndex,CurrentSummaryIndex) =2 THEN "DROPPED"
ELSE "ADDED"
ELSE
ToText( GridValueAt(CurrentRowIndex, CurrentColumnIndex,CurrentSummaryIndex),2,",")
My crosstab displays the total hours for each user. The display Column's grand total is formatted as a percentage:
Task | User1 | User2 | Etc . . .
TotalTime 41.68 44.55
TotalHours 52.17 84.93
% Total 79.89% 52.45%
I use a formula field ({TotalTime}/{TotalHrs}) * 100 - but when I drag that formula field into Summarized Field, I get a Division by zero error. How can I resolve this?
Create a forumula and write below code.
If {TotalHrs}=0
then ToText(0)
Else ToText((({TotalTime}/{TotalHrs}) * 100),2)
Now use this forumula in cross tab.
You could use a numeric formula as well:
If Not(Isnull({TotalHrs})) Then ({TotalTime}/{TotalHrs}) * 100
I have a SSRS report in which there is two column Current_Product and TempAnnSaving.
Current_product has value current product and thier match. that means each current product have a match row or it may be more than one row.Each match row has a TempAnnSaving value in TempAnnSaving column.Now at the end of the report i have to show the total sum of TempannSaving,but there is a condition for sum--i have to sum only first match of each current product .
here is image http://www.imgplace.com/viewimg121/4385/96unled.png
aI guess that the "Current Product" is in the group, if so then do SUM provided by
=IIF (CountRows (Filed!namefield, "nameGroup") = 1, SUM (Field!namefield, "nameGroup"),Nothing)