cancel
Showing results for 
Search instead for 
Did you mean: 

Display all groups in the header section with condition

Former Member
0 Kudos

Hi All,

I've been turning around an issue for 2 days that looks simple to me in the beginning.

Actually I have a group on a database field in my report that displays always 2 values (groups). It's working correctly but I need to bring it to the Header section and display the 2 values as an information.

The values I need are extracted from a table on these 2 conditions:

If Database.field A has value 1 then I need to display in the header the Value in the same row that shows under the field Name X

If Database.field A has value 2 then I need to display in the header the Value in the same row under the field Name Y


The problem is that if I copy the Group from details to the Header section, it shows only one value while I need to display both values consequently.


The ideal solution for me is to show in the report header :


Information A (displays if Database.field A = 1) : Displays to field Name X of this value

Information A (displays if Database.field A = 2) : Displays to field Name Y of this value


Thank you


Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Kumar,

I meant:

Table 1.Field1

Table 1.Field2

Table 1.Field3

1

A

X

1

B

Y

2

A

S

2

B

T

3

A

U

3

B

V


1/ If field 1 contains same values (like here 1 and 1, 2 and 2..)  that means group on same values on field 1 then check for those 2 values the Field 2 if = A then display X (or related value)

2/ same logic

Assumptions:

In Field1 values will always be in pairs

In Field2 values will be always whether A or B

In Field3 values will be all different

Thank you

former_member280812
Active Participant
0 Kudos

Hi Mohamed,

Can you please give the sample output you are trying to get.

Thanks.

Former Member
0 Kudos

Sorry one correction:

Table 1.Field1

Table 1.Field2

Table 1.Field3

1

A

X

1

B

Y

2

A

S

2

B

T

3

A

U

3

B

V

Each time I need to display 2 values : X or Y, S or T u or V...

Thank you

abhilash_kumar
Active Contributor
0 Kudos

Hi Mohamed,

Could you elaborate on :

1/ if field 1 has same values and Field 2 = A then display X

2/ if field 1 has same values and Field 2 = B then display Y

-Abhilash

Former Member
0 Kudos

Ok, the issue is more complicated, let me explain more:

Table 1.Field1

Table 1.Field2

Table 1.Field3

1

A

X

1

B

Y

2

A

X

2

B

Y

3

A

X

3

B

Y

what I need to display in the header is 2 values X and Y.

The conditions:

1/ if field 1 has same values and Field 2 = A then display X

2/ if field 1 has same values and Field 2 = B then display Y

I hope this is more clear.

Thank you

abhilash_kumar
Active Contributor
0 Kudos

Hi Mohamed,

Here's what you need to do:

1) Create a formula (@X) with this code:

If {Database_field} = 1 then 'Info to Display'

2) Go to the Insert Summary option > Choose @X formula field as the 'Field To Summarize' > Choose 'Maximum' as the Summary operation > Under 'Summary Location', choose Group Footer or Report Footer (You can then move them to the Group Header or Report header as needed)

3) Repeat Step 1 and 2 for 'Y'. Just change the formula name to 'Y'.

-Abhilash

Former Member
0 Kudos

Hi Kumar,

Thanks for your fast answer.

When you say If {Database_field} = 1 then 'Info to Display' this means 'Info to Display' is a fixed value, while for me I'm extracting it from the DB_field2. What I need exactly is an equivalent to such sql query:


Select * from DB-Field2 where DB-Field1=X

Thank you

abhilash_kumar
Active Contributor
0 Kudos

You can change the code to:

If {Database_field} = 1 then {Database_field 2}


-Abhilash