What is the syntax to sort on a group. For example:
If group = 1 then sort by field1 ascending
If group = 2 then sort by field2 ascending
If group = 3 then sort by field3 descending
Thanks!There are a couple ways You could write this.
If your "Group" selection is a integer:
=Choose(Parameters!Group.Value,Fields!Field1.Value,
Fields!Field2.Value,Fields!Fields3.Value)
Otherwise
=IIf(Parameters!Group.Value ='1',Fields!Fields1.Value,IIf(Parameters!Group.Value ='2',Fields!Field2.Value,Fields!Field3.Value))
Michael C
"Anonymous" wrote:
> What is the syntax to sort on a group. For example:
> If group = 1 then sort by field1 ascending
> If group = 2 then sort by field2 ascending
> If group = 3 then sort by field3 descending
> Thanks!|||What is the syntax though for desc vs asc.
"Michael C" wrote:
> There are a couple ways You could write this.
> If your "Group" selection is a integer:
> =Choose(Parameters!Group.Value,Fields!Field1.Value,
> Fields!Field2.Value,Fields!Fields3.Value)
> Otherwise
> =IIf(Parameters!Group.Value => '1',Fields!Fields1.Value,IIf(Parameters!Group.Value => '2',Fields!Field2.Value,Fields!Field3.Value))
> Michael C
> "Anonymous" wrote:
> > What is the syntax to sort on a group. For example:
> >
> > If group = 1 then sort by field1 ascending
> > If group = 2 then sort by field2 ascending
> > If group = 3 then sort by field3 descending
> >
> > Thanks!|||On Aug 22, 12:32 pm, Anonymous <Anonym...@.discussions.microsoft.com>
wrote:
> What is the syntax to sort on a group. For example:
> If group = 1 then sort by field1 ascending
> If group = 2 then sort by field2 ascending
> If group = 3 then sort by field3 descending
> Thanks!
Right click the table/matrix control and select Properties. Select the
Groups tab, then select the 'Edit...' button for the Groups to set
sorting on. Then select the 'Sorting' tab and below 'Expression,'
select 'Fields!Field1.Value' and then below 'Direction,' select
'ascending.' Repeat this for the other groups as well. Hope this
helps.
Regards,
Enrique Martinez
Sr. Software Consultantsql
No comments:
Post a Comment