Crystal Reports groups in multiple columns page breaking after row - crystal-reports

I have a crystal report that I formatted to have the groups display in multiple (4) columns across the page, using the Format with Multiple Columns and Format Groups with multiple column options in the section expert.
The data driving the report is (snake draft):
round pick team name
===== ==== ==========
1 1 Charlie
1 2 Bob
1 3 Sam
1 4 Kevin
2 1 Kevin
2 2 Sam
2 3 Bob
2 4 Charlie
3 1 Charlie
3 2 Bob
3 3 Sam
3 4 Kevin
4 1 Kevin
4 2 Sam
4 3 Bob
4 4 Charlie
5 1 Charlie
5 2 Bob
5 3 Sam
5 4 Kevin
6 1 Kevin
6 2 Sam
6 3 Bob
6 4 Charlie
I want the output to look like:
Round 1 Round 2 Round 3 Round 4
1 Charlie 1 Kevin 1 Charlie 1 Kevin
2 Bob 2 Sam 2 Bob 2 Sam
3 Sam 3 Bob 3 Sam 3 Bob
4 Kevin 4 Charlie 4 Kevin 4 Charlie
Round 5 Round 6
1 Charlie 1 Kevin
2 Bob 2 Sam
3 Sam 3 Bob
4 Kevin 4 Charlie
I have 2 problems:
1) I don't need the group footer, but, if I suppress it, the groups don't display in multiple columns across the page, they just go down the page.
2) If I don't suppress the group footer, the first row of columns displays exactly like I want it, but, there is a page break between the rows of columns. So, rounds 5 and 6 appear on the next page. I have verified that all of the 'new page' options are unchecked in the section expert.
I have the "Round #" in the group header and that is showing correctly. One thing that is weird is that if I put a literal in the group footer, it shows at the very bottom of the page below each column. It's as if CR wants to use the entire page for the column height, even though it doesn't need it.
Can anyone help me out?
Thanks,
Dan

Keep the round information in the main report. Put the # in the details section and format in multiple sections (like you've done).
Move the pick/teammate information to a subreport. format as desired. place subreport in a second detials section. link main to subreport on round.

Related

Tableau display 3 measures in 1 column

I am building a report in Tableau with 4 fields. 3 of these fields are measure fields. This is what it looks like.
Name Sum Profit Loss
Emmy 15 10 5
Sara 23 18 2
Dave 10 1 2
But, I want it to look like this. I want a new column called metrics that pulls in those 3 values.
Metrics
Emily 15
10
5
Sara 23
18
2
Dave 10
1
2
May I have some guidance on how I can approach this?
The easiest way to solve this is by bringing "Measure Names" to Rows
You can hide the header names of the measures as well. hope that helps

How to add an iterative id column which goes up when a value in another column resets to 1 in Postgresql

I have a SQL table which has two columns called seq and sub_seq as seen below. I would like to add a third column called id, which goes up by 1 every time the sub_seq starts again at 1 as shown in the table below.
seq
sub_seq
id
1
1
1
2
2
1
3
3
1
4
4
1
5
5
1
6
1
2
7
2
2
8
3
2
9
1
3
10
2
3
11
3
3
12
4
3
13
5
3
14
6
3
15
7
3
I could write a solution using plpgsql, however I would like to know if there is a way of doing this in standard SQL. Any help would be greatly appreciated.
If sub_seq is always a running sequence then you can use the DENSE RANK function and order over the differences of two columns, assuming it will consistently uniform.
SELECT seq, sub_Seq, DENSE_RANK() OVER (ORDER BY seq-sub_Seq) AS id
FROM tableDemo
This solution is based on the sample data you have provided, I think more sample data would be helpful to check the whole scenario.

Count the number of membership changes across multiple vectors

I have 2 vectors in which elements of a similar value are considered to be of the same group, something like this:
V1 V2
1 7
1 8
1 8
1 8
1 9
2 10
3 11
3 11
3 11
3 12
4 12
4 12
In this example, V1 has 4 groups, group 1 has the first 5 elements , group 2 has the next 1 element, group 3 has the next 4 elements, and group 4 has the last 2 elements. V2 has 5 groups, group 1 has the first element, group 2 has the next 3 elements, etc.
Now, I would like to count the number of time an element switches groups, using V1 as the reference. Let's consider group 1 in V1. The first 5 elements are in this same group. In V2, that's no longer the case because V2(1,1) and V2(5,1) do not have the same value as the remaining elements and thus are considered to have switched/changed membership. Applied the same principle, there is no switch for group 2 (i.e.,V1(6,1) and V2(6,1)), one switch for group 3, and no switch for group 4. Total is 3 switches.
At first I thought this would be a simple calculation with no. of switches = numel(unique(V1)) - numel(unique(V2)). However, as you can see, this underestimates the number of switches. Does anyone have a solution to this?
I also welcome a solution to a simpler problem in which V1 contains only one group, like this:
V1 V2
2 7
2 8
2 8
2 8
2 8
2 8
2 8
2 9
2 8
2 10
2 10
2 8
In this second case, the count is 4 nodes that switch: V2(1,1), V2(8,1), V2(10,1), V2(11,1).
Side note: this is actually a network problem: V1 and V2 are partitions and I'm trying to count the number of time a node switches membership.
Here is a solution using unique and accumarray
u = unique([V1 V2],'rows');
switches = accumarray(u(:,1) , 1, [],#numel)-1;
total_switches = sum(switches)
or you can use histcounts
u = unique([V1 V2],'rows');
switches = histcounts(u(:,1) , [unique(u(:,1)); u(end,1)])-1;
total_switches = sum(switches)

How to find out if numbers are different in pascal?

i can't solve one pascal problem, first i have to enter N which is the number or mesurments, next i enter those mesurments (if N is 5 i enter 5 mesurments for exmaple 3 4 5 6 7). After that i enter Q which is the number of times i check the number of different numbers in a specific part of the row. For example you have input
5 (number of mesurments)
1 2 3 3 4 (mesurments)
3 (number of checkings)
1 3
3 4
1 5 (left number is the starting number from the row, if it's 1 you start from 1, if it's 4 you start from 3 because 3 is the fourth mesurment and the right number is the last number if it's 5 it would be 4 because 4 is the fifth in the row)
And for output you would get
3
1
4 (for the first checking you have number from 1 to 3 (1 2 3) and you have 3 different numbers, second mesurment from 3 to 4 (3 3) and it's 1 different number and last from 1 to 5 there are 4 different numbers)
Hope you understod me, and thanks if you can solve it, i am in highschool now and i am preparing my self for something more complicating :) thanks in advance
The inequality operator of Pascal is <>

Crystal report stack 2 column header in crosstab

Here is my problem. I have crystal 12.1 connected to an access database. I would like to create a crosstab to compare current year sales with prior year. I was able to create the initial cross tab, but I cannot figure out how to add the year(s) under the store name. Here is what I would like it too look like. (CY is current year, PY is prior year)
Store 1 Store2 Store3 ...
---------- --------- --------
CY PY CY PY CY PY
Toys 2 3 4 3 7 7
Clothes 1 4 3 8 8 2
Shoes 2 2 4 5 6 9
I have the store name and CY salses in the crosstab now. I have no idea how to add the the PY header and values. My crosstab has the Store in the columns and the summarized fields have the Toys, Clothes, Shoes, etc values.
Simply add your date field into the columns area of the cross-tab expert (below the store field).
The highlight and click group options, set it to group on year.