Adding summary for group section in crystal report - filter

I am designing a report in which I filter the data and then add a group. I also add a summary field to show the sum of the cost of items in the group. But The amount of sum is not correct, it shows the sum of all items in the group without considering the criteria to filter the data (It sum the cost of all item). However, in the group I have 5 items and the sum should show the sum of cost for these 5 items not all items. But If I use the running total for the cost, it shows the right amount. How can I solve the problem in using the summary field?

Are you putting the summary field in the group footer? A running total field in CR will come up with different sums depending on where you put it in the report, so you have to be a bit careful.

Related

Dynamic Calculated Column on different report level SSAS DAX query

I'm trying to create a calculated column based on a derived measure in SSAS cube, this measure which will count the number of cases per order so for one order if it has 3 cases it will have the value 3.
Now I'm trying to create a bucket attribute which says 1caseOrder,2caseOrder,3caseOrder,3+caseOrder. I tried the below one
IF([nrofcase] = 1, "nrofcase[1]", IF([nrofcase] = 2, "nrofcase[2]",
IF([nrofcase] = 3, "nrofcase[3]", "nrofcase[>3]") )
But it doesn't work as expected, when the level of the report is changed from qtr to week it was suppose to recalculate on different level.
Please let me know if it case work.
Calculated columns are static. When the column is added and when the table is processed, the value is calculated and stored. The only way for the value to change is to reprocess the model. If the formula refers to a DAX measure, it will use the measure without any of the context from the report (eg. no row filters or slicers, etc.).
Think of it this way:
Calculated column is a fact about a row that doesn't change. It is known just by looking at a single row. An example of this is Cost = [Quantity] * [Unit Price]. Cost never changes and is known by looking at the Quantity and Unit Price columns. It doesn't matter what filters or context are in the report. Cost doesn't change.
A measure is a fact about a table. You have to look at multiple rows to calculate its value. An example is Total Cost = SUM(Sales[Cost]). You want this value to change depending on the context of time, region, product, etc., so it's value is not stored but calculated dynamically in the report.
It sounds like for your data, there are multiple rows that tell you the number of cases per order, so this is a measure. Use a measure instead of a calculated column.

Datadog: METRIC.as_rate() vs. per_second(METRIC)

I'm trying to figure out the difference between the in-application modifier as_rate() and the rollup function per_second().
I want a table with two columns: the left column shows the total number of events submitted to a Distribution (in query-speak: count:METRIC{*} by {tag}), and the right column shows the average rate of events per second. The table visualization applies a sum rollup on left column, and an average rollup on the right column, so that the left column should equal the right column multiplied by the total number of seconds in the selected time period.
From reading the docs I expected either of these queries to work for the right column:
count:DISTRIBUTION_METRIC{*} by {tag}.as_rate()
per_second(count:DISTRIBUTION_METRIC{*} by {tag})
But, it turns out that these two queries are not the same. as_rate() is the only one that finds the expected average rate where left = right * num_seconds. In fact, the per_second() rollup does this extra weird thing where metrics with lower total events have higher average rates.
Is someone able to clarify why these two functions are not synonymous and what per_second() does differently?

How to filter obiee analysis but subtotal values?

In the analysis, I need to show all sold items for some period totals of which are bigger that some value let's say 100. When I apply this to item price it filters out items that have less price than given limit. However they contain in that period and participate in forming subtotals.
For example:
Item Price
A 56
B 102
C 9
D 247
Total 414
Here if I set filter price> 100 it would show only items B and D. What I want is to see all items that participate in making total of 414, that is I want to filter by totals. Is it possible in OBIEE??
You have to use Selection Steps which are applied after the execution of the query and hence do not cut off the data stream.
You would say "Keep Only Items having Price > 100".
Sherzodbek any reason why you post all your questions here rather than then Oracle forums?

SSRS Bring Total in to Matrix/Tablix

In the image below I need to calculate the two blank columns 'Percentage Total Pend' and 'Percentage Total NMI'. I need to divide the first column number by the total.
Ex: 1,326/4,491
I have researched how to get the Total value of the group inside and came across 'Inscope' but didn't fully understand the functionality. From what I have gathered this issue is because the Total or Subtotal is outside the grouping or Tablix. Any help would be greatly appreciated
enter image description here

SSRS: sorting rows in group by how many detail rows they contain

I have an SSRS tablix that has three levels of grouping. In the innermost group, I need to sort the rows by how many detail rows they contain. I've researched and tried many custom sort orders on the innermost grouping. I'm working with PHI so I cannot show you my data but here is an idea:
Person A
Monday
Meal 1
Orange
Apple
Meal 2
Carrot
Meal 3
Waffle
Bacon
Milkshake
I need them to sort in order "Meal 3, Meal 1, Meal 2" beneath "Monday"
The underlying datasource is a sql query with a row for each food item. It is complicated, repeatedly unioned, and repeatedly aggregated. I didn't write it, I'm just being asked to sort the resulting report in new ways. I don't want to touch the query because it works and validating a new query is not feasible in the time alotted.
I need a sorting solution in SSRS that will also accommodate doing further odd sorts on the same set (meaning something I can nest other unorthodox sorts into that would fall lower down the sorted list).
I'm using Visual Studio 2010 to build the SSRS report, which I think rules out a number of possibilities, but that's something I didn't choose and can't change.
Look for row groups in the bottom panel (go to view and check on grouping if it's not there). Right click the group for Meal and go to group properties. Go to sorting and click add. For your expression =COUNT(Fields!Food.Value)
Due to the grouping, the count will return the count of all foods in that group for each meal. It should sort it by this count. I believe the correct order in this case would be Z to A (which SSRS will sort numerically high to low).

Resources