cancel
Showing results for 
Search instead for 
Did you mean: 

Create Conditional Group based on Parameter with Multiple Values

Former Member
0 Kudos

Post Author: Leo Demarce

CA Forum: General

I want to create a report where the user can pick the group sort by selecting the order in a parameter. In the parameter I have set it up to have Multiple Values and have created 3 Values. I then want to have the user select the order of the values in the report prompt. I then want to create a formula to select the first value in the list and assign it as Group1. Then the second formula would be assigned as Group2 and would have the 2nd item in the parameter identified. The same for the 3rd.

For example, the parameter would have hard coded A, B, and C. The user can then select the 3 in any order (let's assume the user chose B, A, and then C). My formula for Group1 would then need to be able to extract the 1st value in the parameter. This is what I'm looking for. For example, I know that if I have a Date range in a parameter and want to show the start date in the report header the formula would be MINIMUM({?DateRange})

What would be the formula for selecting the first value in a multiple value parameter, then the 2nd, then the 3rd, etc.

I want this to be used to then identify that Group 1 would then be B, Group 2 would be A, and Group 3 would be C. Each group is assigned to the formula, which is tied to the one parameter with 3 multiple values.

Let me know if this is possible! Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Post Author: Leo Demarce

CA Forum: General

I ended up using the choose function. The parameter, P1, had 3 choices, 1, 2, 3. Each of these had a set of descriptions, let's say that 1 = A, B, C; 2=B, C, A; and 3= C, A, B.

In the database A = Item, B = Customer, C = Location

I then created three formulas; F1, F2 and F3. F1 contained the formula choose(P1, Item, Customer, Location) F2 contained the formula choose(P1, Customer, Location, Item)F3 contained the formula choose(P1, Location, Item, Customer)If the user chooses 2, then the grouping will be B,C,A which is the 2nd choice in each of the 3 formulas above.

I then created Group1 based on F1, Group2 based on F2 and Group3 based on F3.

Does anybody have an easier way to do this?

Former Member
0 Kudos

Post Author: V361

CA Forum: General

Take a look at the sample reports, feature examples, prompting.rpt, it has some good examples of Prompting options. If that doesn't get you anywhere, please post some sample data if possible, plus the levels of prompting you are wanting.

Former Member
0 Kudos

Post Author: Leo Demarce

CA Forum: General

XI thanks

Former Member
0 Kudos

Post Author: V361

CA Forum: General

What version of CR are you running