cancel
Showing results for 
Search instead for 
Did you mean: 

One query two different Group By

Former Member
0 Kudos

In My parameter two option one and two.

if i select one, need to come this group by:-

GROUP BY

Name1,

Name2,

Country,

MCC || '/' | MNC

One Output:

Name1 - Name2 - Country - PNR

if i select two, need to come this group by

GROUP BY

Name1,

Country,

MCC || '/' | MNC

two output :

Name1 - Country - PNR

I have only one sql query But i have two different group by

Please advise me, m not using subreport option.

whether any formulas or any other options for group by.

Accepted Solutions (1)

Accepted Solutions (1)

former_member292966
Active Contributor
0 Kudos

Hi,

Create a formula like:

Select {?Parameter} 
    Case 1     :{table.Name1} & {table.Name2} & {table.Country} & {table.PNR}
    Case 2     :{table.Name1} & {table.Country} & {table.PNR};

Now create a group based on this formula in the report. Depending on the value of the parameter, it will group accordingly.

Good luck,

Brian

Answers (1)

Answers (1)

Former Member
0 Kudos

Try inserting the groups statically that are common for both the parameaters like this

GROUP BY

Name1,

Country,

MCC || '/' | MNC

and now create a formula like this

whilereadingrecords;

if =1 then

{Name2 field}

else

""

Now insert one more group using this formula and move the group to second level by using group options.

Hope this helps!

Raghavendra