Filter where search argument changed depending on naother value

I want to filter (=Searchargument) my dataset by something like this:

IF Customer = 'Peter' Then

   Searchargument = Username

ELSE

  Searchargument = Company

END

I want to filter on searchargument which value can be different and depends on a earlier selection.

Hope someone can help me, best regards,

Peter

September 9th, 2015 3:44am

Hi Milan,

Thanks for answering, but I don't think my question is clear enough.

I don't want user actions to filter my data, so I want to filter my data before it display on my screen. Filter depends  on the data in the datasource.

I guess I have to modify my Datasource query with something like a IF-statement.

Any suggestions?

Best regards,

Peter

September 9th, 2015 4:19am

Hi Peter,

Based on my understanding, you want to create a filtered dataset to return different data based on parameter selection, right?

In your scenario, if the Customer is a variable, it will create a report parameter dynamically in the report. You need to specify values for the parameter(like Peter). The query should be written in dataset like below:

IF @Customer = 'Peter' Then

   Searchargument = Username

ELSE

  Searchargument = Company 

END

For more information, please refer to this article: Building Reports With Dynamic Datasets.

Besides, we can also add a dataset filter condition. The condition should look like below:
Expression: Fields!searchargument.value
Operator: =
Value: IIf(Fields!Customer.value = "Peter", Username, company)

If the method posted above doesnt meet your requirement, please share some sample data and report design for our analysis. Also please provide expected results.

If you have any question, please feel free to ask.

Best regards,
Qiuyun Yu

Free Windows Admin Tool Kit Click here and download it now
September 10th, 2015 2:54am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics