Showing posts with label filter. Show all posts
Showing posts with label filter. Show all posts

Wednesday, March 21, 2012

No available values in Report Builder parameter

In a Report builder report I have runtime prompt filter on a field.
But I am not able to see the available values in the dropdown for this field.
My filter is on a "New Field" with the formula :
IF(LENGTH(FieldName)>0,FieldName,("Blank"))

However if my filter is on the FieldName directly and not on the New Field with the above formula I do get the available values.
Is there any way I can get the available values in a dropdown for the New Field?

In Model Designer, add the "New Field" formula as a new attribute to the entity. Then set ValueSelection of the attribute to be dropdown.|||

True any field which is present in the Model can be shown in the dropdown.

I was exploring if a new formula field that is not actually present in the model, might also have 'Available values'.Thanks for your response.

sql

No available values in Report Builder parameter

In a Report builder report I have runtime prompt filter on a field.
But I am not able to see the available values in the dropdown for this field.
My filter is on a "New Field" with the formula :
IF(LENGTH(FieldName)>0,FieldName,("Blank"))

However if my filter is on the FieldName directly and not on the New Field with the above formula I do get the available values.
Is there any way I can get the available values in a dropdown for the New Field?

In Model Designer, add the "New Field" formula as a new attribute to the entity. Then set ValueSelection of the attribute to be dropdown.|||

True any field which is present in the Model can be shown in the dropdown.

I was exploring if a new formula field that is not actually present in the model, might also have 'Available values'.Thanks for your response.

Tuesday, March 20, 2012

No "Existing" word... How?

I am rendering an Association Rules on Report Services. How do I make to filter the word "Existing", just like example below? I want to show attribute name only.

Pneu ML Road = Existing, Sport-100 = Existing -> Road Tubo de Pneu = Existing

to

Pneu ML Road, Sport-100 -> Road Tubo de Pneu

By the way I am using this code:

SELECT NODE_DESCRIPTION,ROUND(NODE_PROBABILITY,2)AS Probabilidade,ROUND(MSOLAP_NODE_SCORE,2)AS Importancia
from [Association].CONTENT
where NODE_TYPE=8

NODE_DESCRIPTION is a string field generated by the algorithm. It contains predicates having the form "Attribute = value" which, in the case of nested table keys, translate to "Road Tubo = Existing".

The "Existing" keyword cannot be removed from the NODE_DESCRIPTION. However, it is coming from the server's string resources. That means, if you install a localized version of the server, you will get a localized version of Existing. Furthermore, the server will attempt to "localize" the Existing string to the thread locales of the client application, as long as the respective resources are available on the server side.

Now, to get rid completely of the Existing keyword, there are a few ways:

- write a server side stored procedure which: traverses the rules in the model content, extracts the node unique names for the itemsets as well as the attribute states, then generates a string which contains the attribute name but not the value (pretty much what the stored procedures used by the built-in viewer do).

Then, invoke the stored procedure with a CALL statement.

OR:

- write a very simple C# class library, containing a single function, Replace, which takes 3 strings as arguments

string Replace(string source, string oldValue, string newValue)

{

return source.Replace(oldValue, newValue);

}

Then, deploy the assembly on the server and change your query like below:

SELECT MyAssembly.Replace(NODE_DESCRIPTION, '= Existing', ''),ROUND(NODE_PROBABILITY,2)AS Probabilidade,ROUND(MSOLAP_NODE_SCORE,2)AS Importancia
from [Association].CONTENT
where NODE_TYPE=8

While not as reliable as the first solution, this is much easier to implement and will generally work correctly, as long as the only attributes in your model are the nested table keys .

|||

You did inspired me, but I found a better solution:

Just click right button on the table, click in "Expression" and change the code Fields!Regra.Value to =Replace(Fields!Regra.Value," = Existing","")

Thank you very much!

Friday, March 9, 2012

next 30 days or all values

Hi,
I have a dataset and I need to be able to filter that data based on
Completion Date.
I have created a user parameter is SSRS with the following values:
0 = All Dates
1 = Next 30 days
I am trying to filter my dataset but I don't know how to filter this
based on my user parameter.
Help!
JasonI figured it out
if the user selects "All" then Parameter!Completion.Value = 0
if the user selects "Next 30 Days" then Parameter!Completion.Value = 1
so my filter looks like:
=iif (Parameters!Completion.Value=1, date.Today.AddDays(30),
date.MaxValue)