Showing posts with label apply. Show all posts
Showing posts with label apply. Show all posts

Wednesday, March 28, 2012

MAX doesn't apply for concatenated variables?

If I load up a local variable defined as varchar(MAX) with a 10,000-character continuous string, i.e. '123456789.....100000' the variable retains the full value as expected. However, if I break that string up into '123456789....5000' + '5001...10000', the variable is truncated at 8000 characters.

Is there a way around this?

Thanks.

This has to do with type conversion. SQL Server does not do an auto coversion from a not max varchar to a max varchar. The key is to cast your values to a varchar(max) type. For example:

select len (replicate ('*',10000))

--

8000

select len (replicate (cast('*' as varchar(max)),10000))

--

10000

sql

Monday, March 12, 2012

Matrix Drill Down Issue

I have a matrix with dynamic columns and rows. If I apply any filters to the
row groups then the higher levels only reflect the first "store" result set
in the higher levels instead of the aggregate total. If I remove the filters
on each group then the values at each level are correct but my first
[member_caption] at each level is null.
Expression: =Fields!location_Division.Value="" operator: = value: =false
Thanks in advance for your help.
col1 col2 col3 col4 col5 col6
division 5 5 4 4 5 4
region 5 5 4 4 5 4
district 1 5 5 4 4 5 4
store 10 5 5 4 4 5 4
store 12 3 1 2 3 2 3Found a way around this problem....have to select the leaves in your MDX
and sum the column value......
"Raz" wrote:
> I have a matrix with dynamic columns and rows. If I apply any filters to the
> row groups then the higher levels only reflect the first "store" result set
> in the higher levels instead of the aggregate total. If I remove the filters
> on each group then the values at each level are correct but my first
> [member_caption] at each level is null.
> Expression: =Fields!location_Division.Value="" operator: = value: =false
> Thanks in advance for your help.
> col1 col2 col3 col4 col5 col6
> division 5 5 4 4 5 4
> region 5 5 4 4 5 4
> district 1 5 5 4 4 5 4
> store 10 5 5 4 4 5 4
> store 12 3 1 2 3 2 3