Crystal Reports 2008- distinct count based on condition - tsql

I have a table that has a column with unique call numbers and another column that has seconds between events. I want to do a distinct count of the call numbers if the seconds between events is greater than 0. I do not see any nulls in this column.
I tried to do a simple Running Total, but it is not counting correctly. I only get a 0 or a 1, not a running total.
Running Total
Formula
Thanks in advance, any help is appreciated.

Related

Want to SUM all values for a specific date within column NOT sum all values in that column

I want to create a graph which shows the total capacity for each week relative to remaining availability across a series of specific dates. Just now when I attempt this in Power Bi it calculates this correctly for one of the values (remaining availability) but generates a value much higher than expected by manual calculation for the total capacity - instead showing the total for the entire column rather than for each specific date.
Why is Power Bi doing this and how can I solve it?
So far, I have tried generating the graph like this:
(https://i.stack.imgur.com/GV3vk.png)
and as you can see the capacity values are incredibly high they should be 25 days.
The total availability values are correct (ranging from 0 to 5.5 days).
When I create matrices to see the sum breakdown they are correct but it only appears to be that when combined together one of the values changes to the value for the whole column.
If anyone could help me with this issue that would be great! Thanks!

How to calculate the number of rows in CDAP/DATA Fusion?

How to calculate the number of rows, for example, I use the NullFieldSplitter plugin to divide the data into two parts, and I want to calculate the number of rows for each part. How to calculate it? Someone can take a look and help me, thanks.
You can count number of records using the Group By plugin under the Analytics section. After you split the record, you can pass them to the Group By to calculate the number of records for each of the ports using the Count aggregation method.

How to specify conditions for count measure in SSAS MDX?

I have a fact table which has column with both positive and negative values. Once I process the cube I can see the count measure automatically added which gives me the count of rows. How can I write a condition on this measure so it will not count the rows with negative values. Please help thanks

Different Total Types in Tableau

I am trying to use Tableau's row total function but am running into a challenge. In the same widget I have Rows 1 - 4 with Numbers. Row 5 is a percentage.
What I would like to do is have Rows 1 - 4 use a Sum Total and Row 5 use an Average total.
Any suggestions on how I can do this?
Thanks,
I don't believe you can use different total metrics on the same worksheet.
What you can do is to create 2 different worsheets, and bring them side by side on a dashboard. Then use the proper Total metric in each.
But beware on calculation average of percentages, because they might be twisted. Usually weighted average is required to accurately express the "average" of a percentage.
What you can do is to actually calculate the percentage (use a calculated field) via the division of two metrics. That way, when you do Totals you will actually a valid value for the "average" of the percentage.
As an exercise, suppose you have sales (in $) in first row, and # of clients in row 2. Now I create a calculated field called ticket, that is
SUM(sales) / sum([# of clients])
That way I can add that to a third row, and for each column I'll have the right number of ticket, and if I add a Row Grand Total, I'll get the actual average ticket value (that is total sales / total # clients), because Tableau will sum all sales, sum all # clients and them perform the calculation (the division)

Crystal report loop

I have a running total and would like to stop it when a condition is matched.
Eg: I have STOCK qty 100pcs; qty is accumulated from Purchase Order Receiving transactions as below:
No. Qty Accumulate
1. 20 20
2. 30 50
3. 10 60
4. 40 100
5. 20 120
The running total should stop at no. 4, because it has reached the STOCK qty 100.
How can this be done?
I'm not sure I understand perfectly what you would like to achieve.
The running total cannot "stop". The running total evaluates by the rules set by you at the time you create the running total. If I remember well you have four options.
evaluate for each record
on change of a field
change of a group
formula
If we assume that you wanted to reset the running total after every 100 then you need to evaluate for each record (1).
For reset you have again four options:
never
on change of a field
change of a group
formula
Here you could write a formula (4) to check for the amount and reset every time when the counter reaches 100.