Hide Total Row in Rep[orting services - service

I have a report with total lines after a show is being reported.
A show may run a week or several weeks. I want to hide the total line when there is only 1 week for the show but display the total line when there are more than one week. The example below should hide the Total row for "An American In Paris" but show for the other shows because they run for more than 1 week.I group by performance, week, start date.
I have tried:
=IIF(SUM(Fields!week_performance.Value)<=1,True,False)
and
=IIF((Fields!week_performance.Value)<=1,True,False)
neither seems to work, even if week = 1 the total line still shows
Performance week sales
A Gentlemens guide to Love & Murder 1 1500
2 2000
Total 3500
An American in Paris 1 1800
Total 1800
First Date 1 1900
2 2100
3 1800
Total 58000

I think what you need is the CountRows() function. In this case, using it as follows will default to the current scope (i.e., the group of the showing, in this case) and should count just 1.
=IIF(CountRows() = 1,true,false)
In addition to CountRows(), if you had some unique value per showing, you could use the following:
=IIF(CountDistinct(Fields!UniqueID.Value) = 1,true,false)
If this doesn't work, reply as a comment and I'll do my best to help.

Related

SRSS 2016/Report Builder 2016 - row groups not able to collate by date?

I'm trying to make a report of daily work for a group of users in a database.
it's filtered by a date range, start date and end date. It then shows a list of the users and a total of things they did during that date range.
My boss wants it to then be expandable to show a breakdown of daily totals.
I can get it to open up and show a breakdown, but it's showing like this example here:
7-1-2018 to 7-2-2018
Jane Doe 5
7/1/2018 1
7/1/2018 1
7/1/2018 1
7/2/2018 1
7/2/2018 1
I've tried to mess with the groups of which there are currenlty only two, the name and the 'dateindexed' which is the entry in the database for when they do what they do. IT has a time stamp on it was well, but need to just have date and total.
I've tried to aggregate it and it then throws an error about no aggregation being allowed when there are filters present in the report.
Any tips or tricks to get this to collapse down on just the date and give a total for the days?
Thank you in advance.

Tableau - Building a calculated field based on a filtered date range

I need to build a calculation that takes into account whether or not someone checks on a day in Tableau. Currently using Tableau 10.0.5.
For instance, say I have the following data
Date Amount
1-Oct 100
1-Oct 120
2-Oct 150
3-Oct 200
4-Oct 250
5-Oct 500
I need a way to calculate the total amount for the days that are checked in a filter. So, if a user selected Oct 1 to Oct 3, the amount would be $570. Any ideas on how to make this happen are appreciated.
I know how much we all love to work with dates in Tableau! :-)
If you are not showing dates in your viz then simply sum([Amount]) will give you the sum of amount for selected dates.
In case you want to show individual dates and sum of sales across all dates you will have to use Level of Detail Expression
{ EXCLUDE [Date]:SUM([Amount])}
Here is the URL for Example

TABLEAU Calculating a Running DISTINCT COUNT on usernames for last 3 months

Issue:
Need to show RUNNING DISTINCT users per 3-month interval^^. (See goal table as reference). However, “COUNTD” does not help even after table calculation or “WINDOW_COUNT” or “WINDOW_SUM” function.
^^RUNNING DISTINCT user means DISTINCT users in a period of time (Jan - Mar, Feb – Apr, etc.). The COUNTD option only COUNT DISTINCT users in a window. This process should go over 3-month window to find the DISTINCT users.
Original Table
Date Username
1/1/2016 A
1/1/2016 B
1/2/2016 C
2/1/2016 A
2/1/2016 B
2/2/2016 B
3/1/2016 B
3/1/2016 C
3/2/2016 D
4/1/2016 A
4/1/2016 C
4/2/2016 D
4/3/2016 F
5/1/2016 D
5/2/2016 F
6/1/2016 D
6/2/2016 F
6/3/2016 G
6/4/2016 H
Goal Table
Tried Methods:
Step-by-step:
Tried to distribute the problem into steps, but due to columnar nature of tableau, I cannot successfully run COUNT or SUM (any aggregate command) on the LAST STEP of the solution.
STEP 0 Raw Data
This tables show the structure Data, as it is in the original table.
STEP 1 COUNT usernames by MONTH
The table show the count of users by month. You will notice because user B had 2 entries he is counted twice. In the next step we use DISTINCT COUNT to fix this issue.
STEP 2 DISTINCT COUNT by MONTH
Now we can see who all were present in a month, next step would be to see running DISTINCT COUNT by MONTH for 3 months
STEP 3 RUNNING DISTINCT COUNT for 3 months
Now we can see the SUM of DISTINCT COUNT of usernames for running 3 months. If you turn the MONTH INTERVAL to 1 from 3, you can see STEP 2 table.
LAST STEP Issue Step
GOAL: Need the GRAND TOTAL to be the SUM of MONTH column.
Request:
I want to calculate the SUM of '1' by MONTH. However, I am using WINDOW function and aggregating the data that gave me an Error.
WHAT I NEED
Jan Feb March April May Jun
3 3 4 5 5 6
WHAT I GOT
Jan Feb March April May Jun
1 1 1 1 1 1
My Output after tried methods: Attached twbx file. DISTINCT_count_running_v1
HELP taken:
https://community.tableau.com/thread/119179 ; Tried this method but stuck at last step
https://community.tableau.com/thread/122852 ; Used some parts of this solution
The way I approached the problem was identifying the minimum login date for each user and then using that date to count the distinct number of users. For example, I have data in this format. I created a calculated field called Min User Login Date as { FIXED [User]:MIN([Date])} and then did a CNTD(USER) on Min User Login Date to get the unique user count by date. If you want running total, then you can do quick table calculation on Running Total on CNTD(USER) field.
You need to put Month(date) and count(username) in the columns then you will get result what you expect.
See screen below

Crystal Reports Conditional Grouping on Unrelated DB Field

I have some data in table SSTemp like this ("..." indicates data omitted for readability):
Month Year Number Gross Net
1 2013 1 1,000 500
2 2013 1 1,000 500
...
12 2013 1 1,000 500
1 2014 1 1,000 500
2 2014 1 1,000 500
...
12 2014 1 1,000 500
1 2015 1 1,000 500
...
12 2015 1 1,000 500
I am new to Crystal Reports and am using version 8 (no, we can't upgrade). I want to roll up the totals for all line items in years past and leave the data as-is for the current year in the same report. Database field {CONTROLFILE.CURRENTYEAR} contains the current bookkeeping year for our system which is vital to determine the rollup groups. The CONTROLFILE table contains general settings for the system and has no data in it useful for JOINing, however I need to consider CURRENTYEAR for the grouping. The MONTH column should be blank on the summary lines, and indicate month on the current year lines. The end result data should look like this:
Month Year Number Gross Net
2013 12 12,000 6,000
2014 12 12,000 6,000
1 2015 1 1,000 500
2 2015 1 1,000 500
...
12 2015 1 1,000 500
Any suggestions would be most appreciated!
Use sub report concept.
In main report calculate for previous years in sub report calculate for current year.
In main report group by year And suppress details show summary in group footer in another group footer section place sub report and just place data in detail part don't group

How do I Loop through a schedule in Crystal Reports

I'm building a report in Crystal Reports 2008. The report is dealing with employee's schedules. There are time slots where the schedule is open, and time slots where the schedule is unavailable.
Currently, I've built my logic so that it finds the start and end of an unavailable time. The report them tells me how many hours that particular staff person was unavailable.
My issue is that sometimes, staff people have a block at the beginning of their schedule marked as 'unavailable', and a block at the end of the day as 'unavailable', but between the two they are 'open'. Thus, the report says that particular staff person was out the whole day, but they actually worked. It isn't an option to tell these particular staff people how to schedule their day - they decide their own schedule, and I write the report to accomodate their needs.
SCHEDULE_TIME EMP_ID UNAVAILABLE_CODE WORK_LENGTH
7/5/2011 11:00 100 NULL 15
7/5/2011 11:15 100 NULL 15
7/5/2011 11:30 100 NULL 15
7/5/2011 11:45 100 NULL 15
7/5/2011 12:00 100 15 5
7/5/2011 17:00 100 15 5
This example shows how somebody would have a 5 hour block calculated for unavailable time, but it's only 2 appointments. For the code, I'm using DATEDIFF between appointment times.
(Essentially, they have built in more than one 'unavailable' block, and my logic will only accomodate one 'unavailable' block per day).
I'm pretty sure that I need to run a type of DO...WHILE loop within the report in order to calculate the total hours unavailable. I'm just not sure how to structure the loop in Crystal Reports.
Maybe i'm missing something but what you want to do looks straight forward. Two obvious options:
Running total:
Set the field to {TABLE.WORK_LENGTH}
Set the type to sum
Set the evaluation formula to not(isnull({TABLE.UNAVAILABLE_CODE}))
Set the reset on change of group/field {TABLE.EMP_ID} (assuming you're looking for totals per employee)
Formula/sum:
Create a formula field unavailable_time with if not(isnull({TABLE.UNAVAILABLE_CODE})) then {TABLE.WORK_LENGTH} else 0
Create a group on {TABLE.EMP_ID}
Create a sum on your formula field in the group footer