Showing posts with label subtotal. Show all posts
Showing posts with label subtotal. Show all posts

Monday, February 20, 2012

navigation on subtotal

I have a matrix and a subtotal footer summing up a group of numbers. Each row has a primary key. I use the primary key to drill-through another report through "Navigation".

Unfortunately, the generated subtotal column also have a link but it has a primary key of whatever the first row is, which shouldn't have a primary key. So I can drill-through the subtotal but it returns the wrong result.

I have not been able to override the subtotal to specify a new link with different paramters.

Anybody can help would be great!

Thanks.

In the place where you define the drillthrough action with its parameters, you have to use the InScope(...) function to determine if your are in a subtotal or not.

Please check the MSDN documentation about the InScope function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_0jmt.asp

With InScope you can determine the current scope of a matrix cell. Note: a matrix cell is "in scope" of column and row groupings, so you need at least two InScope function calls in the case where you have one dynamic row and one dynamic column grouping. E.g.
=iif(InScope("ColumnGroup1"), iif(InScope("RowGroup1"), "In Cell", "In Subtotal of RowGroup1"), iif(InScope("RowGroup1"), "In Subtotal of ColumnGroup1", "In Subtotal of entire matrix"))

-- Robert

|||Thanks for the suggestion. But I have two dynamic rows, one for SubTotal and one for Grand Total.

<DynamicRows>
<Grouping Name="GrandTotal">
....
<DynamicRows>
<Grouping Name="SubTotal">
...

I am having a hard time to link it to a correct report as it appears that GrandTotal is in scope of SubTotal. I am not sure to put that in the omit node as well.

If you can give me some instructions that would be great.

Thanks.

Jason
|||there are two subtotals, one is the rightmost column and the other is the bottom row. How can I disable the navigation for these two subtotals and still have navigation "In Cell"? Thanks if you can help or point out some resouces that I can go check.|||

Use the InScope function as described earlier in this thread.

For the cells, you would generate the desired hyperlink or drillthrough link. For subtotal scope you would just return Nothing (i.e. VB equivalent of null) in the IIF arguments. If a hyperlink expression evaluates to Nothing for a particular cell, the hyperlink action will be removed entirely.

-- Robert

|||

Hi, Robert,

The problem is still not solved. I still want the subtotal number shows on rightmost column and bottom row. The way that you told me, I will get empty column and row on the end. Let me try an example here:

co1 col2 col3 subtotal

row1 3 5 7 15

row2 1 2 3 6

subtotal 4 7 10 21

3, 5, 7, 1, 2, and 3, will have a hyperlink to jump to another report show detailed page, but I wanto 4, 7, 10, 15, 6, and 21 to show the number but disable the hyplerlinks.

Thanks!

Henry

|||

Yes, that should work fine.

For the matrix cell, you use an expression that shows calculates the value (e.g. =Sum(Fields!A.Value)).

Then, on that textbox add a navigation action. Only for the hyperlink expression you would use the complex expression using IIF calls and InScope calls.

Hope this clarifies it.

|||

Hi, Robert,

It works now. Thanks!

The key point: "sum(fields!a.value)" in Matrix cell and complex expression using iif and inscope in navigation action.

Henry

|||

hi,

can u please send me the query you used.

and please also gimme a explanation if possible.

Thanks in advance,

Vinu

navigation on subtotal

I have a matrix and a subtotal footer summing up a group of numbers. Each row has a primary key. I use the primary key to drill-through another report through "Navigation".

Unfortunately, the generated subtotal column also have a link but it has a primary key of whatever the first row is, which shouldn't have a primary key. So I can drill-through the subtotal but it returns the wrong result.

I have not been able to override the subtotal to specify a new link with different paramters.

Anybody can help would be great!

Thanks.

In the place where you define the drillthrough action with its parameters, you have to use the InScope(...) function to determine if your are in a subtotal or not.

Please check the MSDN documentation about the InScope function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSCREATE/htm/rcr_creating_expressions_v1_0jmt.asp

With InScope you can determine the current scope of a matrix cell. Note: a matrix cell is "in scope" of column and row groupings, so you need at least two InScope function calls in the case where you have one dynamic row and one dynamic column grouping. E.g.
=iif(InScope("ColumnGroup1"), iif(InScope("RowGroup1"), "In Cell", "In Subtotal of RowGroup1"), iif(InScope("RowGroup1"), "In Subtotal of ColumnGroup1", "In Subtotal of entire matrix"))

-- Robert

|||Thanks for the suggestion. But I have two dynamic rows, one for SubTotal and one for Grand Total.

<DynamicRows>
<Grouping Name="GrandTotal">
....
<DynamicRows>
<Grouping Name="SubTotal">
...

I am having a hard time to link it to a correct report as it appears that GrandTotal is in scope of SubTotal. I am not sure to put that in the omit node as well.

If you can give me some instructions that would be great.

Thanks.

Jason|||there are two subtotals, one is the rightmost column and the other is the bottom row. How can I disable the navigation for these two subtotals and still have navigation "In Cell"? Thanks if you can help or point out some resouces that I can go check.|||

Use the InScope function as described earlier in this thread.

For the cells, you would generate the desired hyperlink or drillthrough link. For subtotal scope you would just return Nothing (i.e. VB equivalent of null) in the IIF arguments. If a hyperlink expression evaluates to Nothing for a particular cell, the hyperlink action will be removed entirely.

-- Robert

|||

Hi, Robert,

The problem is still not solved. I still want the subtotal number shows on rightmost column and bottom row. The way that you told me, I will get empty column and row on the end. Let me try an example here:

co1 col2 col3 subtotal

row1 3 5 7 15

row2 1 2 3 6

subtotal 4 7 10 21

3, 5, 7, 1, 2, and 3, will have a hyperlink to jump to another report show detailed page, but I wanto 4, 7, 10, 15, 6, and 21 to show the number but disable the hyplerlinks.

Thanks!

Henry

|||

Yes, that should work fine.

For the matrix cell, you use an expression that shows calculates the value (e.g. =Sum(Fields!A.Value)).

Then, on that textbox add a navigation action. Only for the hyperlink expression you would use the complex expression using IIF calls and InScope calls.

Hope this clarifies it.

|||

Hi, Robert,

It works now. Thanks!

The key point: "sum(fields!a.value)" in Matrix cell and complex expression using iif and inscope in navigation action.

Henry

|||

hi,

can u please send me the query you used.

and please also gimme a explanation if possible.

Thanks in advance,

Vinu

Navigation on Matrix Subtotal

Here's a sample matrix:

Men Women Total

Full Professor 36 12 48

Assoc. Professor 16 9 25

Assistant Professor 11 14 25

Total 63 35 98

Now, it's easy enough to make the values clickable so that somebody can drill down to a report that shows detail about the people. I have also discovered how to turn off clickability on the totals. However, what I really want is for the totals to be clickable so that, for example, if I click on the 63, I see a report that shows all men. Likewise, If I click on the 48, I want to see a report that shows all Full Professors. What currently happens when the totals are clickable is that if I click on the 63, I get all men who are full professors (36 records instead of 63). If I click on the 48, I get all Full Professors who are men. (36 records instead of 48).

Is there any way to send different parameters (or even no parameters) to the secondary report if the subtotals are clicked instead of the regular results?

Thanks in advance!

Daniel,

If your total link you should be passing the SubTtotal report field value - ReportItems!MySubtotal.value and not the Fields!MyMatrix.value.

I hope this helps.

Carl

|||

Thanks for your reply, Carl.

The problem is that the matrix only has one field on which to create the navigation... the data field. The total field is generated automatically, so I don't see how it's possible to creating a unique link for the total itself. If there is a way, please tell me how.

Thanks,
Dan

|||

Yes,

you can just past the "ReportItems!MyField.value" if you click on the "36" it passes "36" if you click on the "58" it passes "58"

Ham

|||

Thanks for your assistance.

But... I'm not sure we're connecting here. In Layout View, the matrix has one data field. I right click on that field and choose Properties. Then I click on the Navigation tab and in the "Jump to report" menu, I choose the name of my sub report. Then I click on Parameters and add the two parameters, =Fields!Gender.Value and =Fields!JobEEO.Value.

Now, when I Preview my report, every number is clickable, including the subtotals. It's just that clicking on the subtotals doesn't bring the correct result, as described in my first post.

I'm trying desperately to explain this so that you can see it, but I have a feeling I'm not doing a very good job...

|||

dj,

Go to where you add the two parameters in the navigation, In the parameter value, select expression, in your expression, you can type " ReportItems! " your intellisense will then allow your to select the Report Field you want to pass.

Ham

|||

The report field values are meaningless as parameters, though. What I really am saying when I click on the 63 is: "Show me a list of all Full Professors, Associate Professors, and Assistant Professors who are Male."

So the parameters I need to pass are

1) JobEEO = Full Professor, Associate Professor, Assistant Professor

2) Gender = Male

|||

Hi,

I think you need to use the InScope function to determine which parameter values to pass.

This link may help:

http://msdn2.microsoft.com/en-us/library/aa255807(sql.80).aspx

Ian.

|||

I have finally figured this out and I though I would pass it on to anyone who needs it in the future.

The best way to deal with this situation is

1) On the sub-report, for a multi-valued parameter, make every option the default. So in my example, the default for the Job EEO would be Full Professors, Associate Professors, and Assistant Professors and the default value for Gender would be both male and female.

2) On the first report, only pass the parameter if its value is in scope. This is accomplished by editing the Omit property of the parameter you are passing... setting it to something like: =Not(InScope("matrix1_Gender"))

This means that if there is no distinct value for the gender, the parameter will not be passed. The subreport will then show data for both genders because that is the subreport's default.

If making every option in a subreport's parameter the default doesnt' work for your needs, there is another way. On the parameter that's being passed out of the first report, you can edit the expression to something like this:

=Iif(InScope("matrix1_Gender"), Fields!Gender.Value, Split("Male,Female", ","))

This, translated into English, says, "If you clicked on a field related to a specific gender, then send that gender to the subreport. Otherwise, send both Male and Female to the subreport."

Navigation on Matrix Subtotal

Here's a sample matrix:

Men Women Total

Full Professor 36 12 48

Assoc. Professor 16 9 25

Assistant Professor 11 14 25

Total 63 35 98

Now, it's easy enough to make the values clickable so that somebody can drill down to a report that shows detail about the people. I have also discovered how to turn off clickability on the totals. However, what I really want is for the totals to be clickable so that, for example, if I click on the 63, I see a report that shows all men. Likewise, If I click on the 48, I want to see a report that shows all Full Professors. What currently happens when the totals are clickable is that if I click on the 63, I get all men who are full professors (36 records instead of 63). If I click on the 48, I get all Full Professors who are men. (36 records instead of 48).

Is there any way to send different parameters (or even no parameters) to the secondary report if the subtotals are clicked instead of the regular results?

Thanks in advance!

Daniel,

If your total link you should be passing the SubTtotal report field value - ReportItems!MySubtotal.value and not the Fields!MyMatrix.value.

I hope this helps.

Carl

|||

Thanks for your reply, Carl.

The problem is that the matrix only has one field on which to create the navigation... the data field. The total field is generated automatically, so I don't see how it's possible to creating a unique link for the total itself. If there is a way, please tell me how.

Thanks,
Dan

|||

Yes,

you can just past the "ReportItems!MyField.value" if you click on the "36" it passes "36" if you click on the "58" it passes "58"

Ham

|||

Thanks for your assistance.

But... I'm not sure we're connecting here. In Layout View, the matrix has one data field. I right click on that field and choose Properties. Then I click on the Navigation tab and in the "Jump to report" menu, I choose the name of my sub report. Then I click on Parameters and add the two parameters, =Fields!Gender.Value and =Fields!JobEEO.Value.

Now, when I Preview my report, every number is clickable, including the subtotals. It's just that clicking on the subtotals doesn't bring the correct result, as described in my first post.

I'm trying desperately to explain this so that you can see it, but I have a feeling I'm not doing a very good job...

|||

dj,

Go to where you add the two parameters in the navigation, In the parameter value, select expression, in your expression, you can type " ReportItems! " your intellisense will then allow your to select the Report Field you want to pass.

Ham

|||

The report field values are meaningless as parameters, though. What I really am saying when I click on the 63 is: "Show me a list of all Full Professors, Associate Professors, and Assistant Professors who are Male."

So the parameters I need to pass are

1) JobEEO = Full Professor, Associate Professor, Assistant Professor

2) Gender = Male

|||

Hi,

I think you need to use the InScope function to determine which parameter values to pass.

This link may help:

http://msdn2.microsoft.com/en-us/library/aa255807(sql.80).aspx

Ian.

|||

I have finally figured this out and I though I would pass it on to anyone who needs it in the future.

The best way to deal with this situation is

1) On the sub-report, for a multi-valued parameter, make every option the default. So in my example, the default for the Job EEO would be Full Professors, Associate Professors, and Assistant Professors and the default value for Gender would be both male and female.

2) On the first report, only pass the parameter if its value is in scope. This is accomplished by editing the Omit property of the parameter you are passing... setting it to something like: =Not(InScope("matrix1_Gender"))

This means that if there is no distinct value for the gender, the parameter will not be passed. The subreport will then show data for both genders because that is the subreport's default.

If making every option in a subreport's parameter the default doesnt' work for your needs, there is another way. On the parameter that's being passed out of the first report, you can edit the expression to something like this:

=Iif(InScope("matrix1_Gender"), Fields!Gender.Value, Split("Male,Female", ","))

This, translated into English, says, "If you clicked on a field related to a specific gender, then send that gender to the subreport. Otherwise, send both Male and Female to the subreport."

Navigation on Matrix Subtotal

Here's a sample matrix:

Men Women Total

Full Professor 36 12 48

Assoc. Professor 16 9 25

Assistant Professor 11 14 25

Total 63 35 98

Now, it's easy enough to make the values clickable so that somebody can drill down to a report that shows detail about the people. I have also discovered how to turn off clickability on the totals. However, what I really want is for the totals to be clickable so that, for example, if I click on the 63, I see a report that shows all men. Likewise, If I click on the 48, I want to see a report that shows all Full Professors. What currently happens when the totals are clickable is that if I click on the 63, I get all men who are full professors (36 records instead of 63). If I click on the 48, I get all Full Professors who are men. (36 records instead of 48).

Is there any way to send different parameters (or even no parameters) to the secondary report if the subtotals are clicked instead of the regular results?

Thanks in advance!

Daniel,

If your total link you should be passing the SubTtotal report field value - ReportItems!MySubtotal.value and not the Fields!MyMatrix.value.

I hope this helps.

Carl

|||

Thanks for your reply, Carl.

The problem is that the matrix only has one field on which to create the navigation... the data field. The total field is generated automatically, so I don't see how it's possible to creating a unique link for the total itself. If there is a way, please tell me how.

Thanks,
Dan

|||

Yes,

you can just past the "ReportItems!MyField.value" if you click on the "36" it passes "36" if you click on the "58" it passes "58"

Ham

|||

Thanks for your assistance.

But... I'm not sure we're connecting here. In Layout View, the matrix has one data field. I right click on that field and choose Properties. Then I click on the Navigation tab and in the "Jump to report" menu, I choose the name of my sub report. Then I click on Parameters and add the two parameters, =Fields!Gender.Value and =Fields!JobEEO.Value.

Now, when I Preview my report, every number is clickable, including the subtotals. It's just that clicking on the subtotals doesn't bring the correct result, as described in my first post.

I'm trying desperately to explain this so that you can see it, but I have a feeling I'm not doing a very good job...

|||

dj,

Go to where you add the two parameters in the navigation, In the parameter value, select expression, in your expression, you can type " ReportItems! " your intellisense will then allow your to select the Report Field you want to pass.

Ham

|||

The report field values are meaningless as parameters, though. What I really am saying when I click on the 63 is: "Show me a list of all Full Professors, Associate Professors, and Assistant Professors who are Male."

So the parameters I need to pass are

1) JobEEO = Full Professor, Associate Professor, Assistant Professor

2) Gender = Male

|||

Hi,

I think you need to use the InScope function to determine which parameter values to pass.

This link may help:

http://msdn2.microsoft.com/en-us/library/aa255807(sql.80).aspx

Ian.

|||

I have finally figured this out and I though I would pass it on to anyone who needs it in the future.

The best way to deal with this situation is

1) On the sub-report, for a multi-valued parameter, make every option the default. So in my example, the default for the Job EEO would be Full Professors, Associate Professors, and Assistant Professors and the default value for Gender would be both male and female.

2) On the first report, only pass the parameter if its value is in scope. This is accomplished by editing the Omit property of the parameter you are passing... setting it to something like: =Not(InScope("matrix1_Gender"))

This means that if there is no distinct value for the gender, the parameter will not be passed. The subreport will then show data for both genders because that is the subreport's default.

If making every option in a subreport's parameter the default doesnt' work for your needs, there is another way. On the parameter that's being passed out of the first report, you can edit the expression to something like this:

=Iif(InScope("matrix1_Gender"), Fields!Gender.Value, Split("Male,Female", ","))

This, translated into English, says, "If you clicked on a field related to a specific gender, then send that gender to the subreport. Otherwise, send both Male and Female to the subreport."

|||Thanks !
It works !