Wednesday, March 21, 2012
referencing value in subreport in calculated field on parent
elsewhere...
this subreport has one txtbox, no grid or any other objects.
is this possible?
what is the syntax...'
i.e. =mysubReport.mytxtbox.value...........
thanksOn Sep 28, 2:51 pm, r...@.mgk.com wrote:
> I wish to reference the value in a subreport in a calculated field
> elsewhere...
> this subreport has one txtbox, no grid or any other objects.
> is this possible?
> what is the syntax...'
> i.e. =mysubReport.mytxtbox.value...........
> thanks
You will need to create a dataset in the main report that accesses the
same data (i.e., query/stored procedure) that is used in the subreport
and add the calculation the same way (basically duplicating the
efforts). Then, in the main report, reference this dataset via an
aggregate expression, for example:
=Max(Fields!SomeFieldName.Value, "NewDataSetName")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||On Sep 29, 10:27 pm, EMartinez <emartinez...@.gmail.com> wrote:
> On Sep 28, 2:51 pm, r...@.mgk.com wrote:
> > I wish to reference the value in a subreport in a calculated field
> > elsewhere...
> > this subreport has one txtbox, no grid or any other objects.
> > is this possible?
> > what is the syntax...'
> > i.e. =mysubReport.mytxtbox.value...........
> > thanks
> You will need to create a dataset in the main report that accesses the
> same data (i.e., query/stored procedure) that is used in the subreport
> and add the calculation the same way (basically duplicating the
> efforts). Then, in the main report, reference this dataset via an
> aggregate expression, for example:
> =Max(Fields!SomeFieldName.Value, "NewDataSetName")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
argh! i was afraid of that...sql
Monday, March 12, 2012
Referencing a calculated field in a query
SELECT Qty, UnitPrice, Tax, Qty*UnitPrice as Expr1, Expr1*(1.0 + Tax) AS Expr2
This problem has occurred after upsizing to SQLExpress from Access XP/Jet Engine. Since Access does not have any issue with the expression above, the SQLExpress does not even accept it.
The only way how to avoid the issue in the SQLExpress seems probably to be
- Duplicate some calculations (i.e. expand every expression with duplicating some mathematic operations with some performance loss)
- Utilize computed columns if possible (no idea on performance impact here)
Am I right or is there any other way how to reference a calculated field?
Any suggestion is greatly welcomed! Thanks in advance.The problem is not really with the calculated field. The problem is that column aliases are not assigned until the SELECT statement's results are processed, so you cannot refer to them within the statement.
Two workarounds are to repeat the formula within the result set each time it is needed, or to calculate expression 1 in a SELECT subquery and then refer to it in expression 2 in the outer query.
Of the two, I prefer the first option most of the time.
Reference previously calculated values in table
Column A contains a complicated calculation. Column b contains a new calculation which requires the value from Column A. Is there a way to reference the Column A value without re-entering the formula.
Thanks for your help in advance.=ReportItems!textbox1.Value.
[Replace textbox1 with the appropriate cell name in the table.]
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"SAcanuck" <SAcanuck@.discussions.microsoft.com> wrote in message
news:1A68EE0F-1789-4F2E-973B-61790F19D657@.microsoft.com...
> I have a table with two columns.
> Column A contains a complicated calculation. Column b contains a new
calculation which requires the value from Column A. Is there a way to
reference the Column A value without re-entering the formula.
> Thanks for your help in advance.
Reference previously calculated values in a table between rows
Is the same thing available between rows?
Thanks for any help.You can refer to the previous value of fields (expressions) in table rows.
Try e.g.:
=Previews(Fields!abc.Value)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"lsff" <lsff@.discussions.microsoft.com> wrote in message
news:C73A4807-BCE9-4B58-A2FC-4E894C07A30D@.microsoft.com...
> I have a requirement where I produce a number of rows in a table footer
and each subsequent rows needs values calculated in the previous row. Fields
in columns can be given a name and used in another column of the same row by
using "=ReportItems!textbox1.Value".
> Is the same thing available between rows?
> Thanks for any help.|||Sorry, I meant:
=Previous(Fields!abc.Value)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:uA75dBFdEHA.3148@.TK2MSFTNGP10.phx.gbl...
> You can refer to the previous value of fields (expressions) in table rows.
> Try e.g.:
> =Previews(Fields!abc.Value)
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "lsff" <lsff@.discussions.microsoft.com> wrote in message
> news:C73A4807-BCE9-4B58-A2FC-4E894C07A30D@.microsoft.com...
> > I have a requirement where I produce a number of rows in a table footer
> and each subsequent rows needs values calculated in the previous row.
Fields
> in columns can be given a name and used in another column of the same row
by
> using "=ReportItems!textbox1.Value".
> >
> > Is the same thing available between rows?
> >
> > Thanks for any help.
>|||Robert,
This didn't do what I needed. For example, I have a field which contains a sum of different values (call it field A). In the next row, I calculate a value based on field A and another field in a different dataset (call this field B). In the third row, I want the total of Fields A and B (call this Field C). At the moment, I include in Field C the formula for field A and add to it the formula from Field B. I have a number of other rows wioth progressive additions. So you can see the formula in the fields keep on getting bigger and bigger. It would be nice to just say Field A + Field B, etc.
"Robert Bruckner [MSFT]" wrote:
> Sorry, I meant:
> =Previous(Fields!abc.Value)
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
> news:uA75dBFdEHA.3148@.TK2MSFTNGP10.phx.gbl...
> > You can refer to the previous value of fields (expressions) in table rows.
> > Try e.g.:
> > =Previews(Fields!abc.Value)
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "lsff" <lsff@.discussions.microsoft.com> wrote in message
> > news:C73A4807-BCE9-4B58-A2FC-4E894C07A30D@.microsoft.com...
> > > I have a requirement where I produce a number of rows in a table footer
> > and each subsequent rows needs values calculated in the previous row.
> Fields
> > in columns can be given a name and used in another column of the same row
> by
> > using "=ReportItems!textbox1.Value".
> > >
> > > Is the same thing available between rows?
> > >
> > > Thanks for any help.
> >
> >
>
>
Friday, March 9, 2012
Reference axis(2) members in MDX
Hello everybody.
I've got a little problem: I want to reference axis(2) members in a calculated member, so I can use multiple selection.
I've tried:
with member [Measures].[Test] as 'settostr(axis(2))'
select {[Measures].[Test]} on 0,
{[Dim Sales Territory].[Sales Territory Region].members} on 1
from [Adventure Works DW]
where ([Dim Geography].[Country Region Code].&[US],[Dim Geography].[Country Region Code].&[CA])
However, I get an error.
Is there any other way?
Thanks a lot,
Santi
The Axis function cannot be used on the filter axis.The Axis function cannot be used on the filter axis.
http://msdn2.microsoft.com/en-us/library/ms145531.aspx
your shuldn't use Axis function if you whant to use multiple filter
|||
Thanks Vladimir.
Then, assuming I have several members on the filter axis, how can I find out what those members are?
Is it at all possible?
The thing is, I'm trying to enable multiple selection in a dimension, and the selected members go directly to the where clause of the query. Since I have some calculated measures, I can′t reference those members using currentmember.
Thanks again for your answer.
|||What the client do you use? Do you have a full control on it.|||You could use the Existing function:
>>
with member [Measures].[Test] as
settostr(Existing [Geography].[Country].[Country].Members)
select {[Measures].[Test]} on 0
from [Adventure Works]
where {[Geography].[Country].&[United States],
[Geography].[Country].&[Canada]}
-
Test
{[Geography].[Country].&[Canada],[Geography].[Country].&[United States]}
>>
This technique is discussed in detail here:
http://sqljunkies.com/WebLog/mosha/archive/2005/11/18/multiselect_friendly_mdx.aspx
>>
Writing multiselect friendly MDX calculations
>>
|||
Thanks a lot Deepak!
Didn't know about Exist and Existing at all.
I've also read Mosha's blog entry, and it explains exactly the internals of what I'm trying to acomplish.