What is the expression syntax to make the visibility of a column hidden in a Tablix?

So if my Parameter value is...

MCCL, MCMA, MCPL, MCPR, MCRE, MCSE, MCSN, MCVA, MCCL, MCEP, MCMA, MCRE out of 43 possible choices, what is the expression syntax to hide my tablix column based on my parameter value?

=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"MCCL","MCMA","MCPL"...)>0,false,true)

Just not sure of the syntax...or do I have to qualify each one???

= IIf(Parameter!PF1.Value = "MCCL" OR Parameter!PF1.Value = "MCMA"..., TRUE, FALSE)

April 21st, 2015 9:31pm

Hi ITBobbyP,

Per my understanding that you have many values in the parameters and you want to conditional show and hide the tablix column based on some of the values in the parameters, right?

If the parameter haven't checked the "Allow Multiple values" in the parameter properties setting then you can use the expression like below to show/hide:
=IIF(Parameter!PF1.Value = "MCCL" OR Parameter!PF1.Value = "MCMA"..., TRUE, FALSE)

If the parameter have checked the "Allow Multiple Values", you will need to use expression as below:
=IIF(Join(Parameter!PF1.Value ,",")="MCCL,MCMA" OR Join(Parameter!PF1.Value ,",") = "MCMA", TRUE, FALSE)

Note: the above expression means when Parameter PF1 have checked "MCCL","MCMA"  or have just checked "MCMA" then will hide.

More information about the IIF function, please reference to the article below:
Expression Examples (Report Builder and SSRS)

If you still have any problem, please feel free to ask.

Regards,
Vicky Liu

Free Windows Admin Tool Kit Click here and download it now
April 22nd, 2015 9:41am

So what exactly is the rule you want to implement?

Under what all cases you want it to be hidden?

April 22nd, 2015 10:00am

Ugh...the plot thickens...sooooo what if I want to base my visibility on the first two characters of my parameter value? Soooo 'MC'??

Thanks for your help so far.

Free Windows Admin Tool Kit Click here and download it now
April 22nd, 2015 1:16pm

Hi ITBobbyP,

Could you please provide more details information about the values in the parameter, If the parameter hasn't check the "Allow Multiple values" and you can use expression below to show and hide:

=IIF(LEFT(Parameters!ShowHide.Value,2)="MC",true,false)

If you still have any problem, please feel free to ask.

Regards,
Vicky Liu

April 23rd, 2015 12:59am

What if it does allow for multiple values?? Like...

COLG,COSM,ININ,MCMA,MCCL,MCPL

Just as an example. Anddddd....this is our "Line Of Business" Parameter which changes. So if I want to make my column ONLY visible for prefixed "MC" do I have to allow for each and every possibility? Perhaps I'm going down the wrong path here. If instead I base visibility on the value of the Business Unit 'MC' in the result set, will my column be visible ONLY if I have "MC" records? Is that a better way to go? I've never really messed around with visibility too much but I don't think we want this column showing <blank> all the time if "MC" records aren't pulled.

Thanks for your patience and hoping for another reply.

Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 2:02pm

Hi ITBobbyP,

Per my understanding that you have create multiple values parameter "ColumnVisibility" based on the fields LineofBusiness and the fields LineofBusiness have the n to 1 relationship with the BusinessUnit like below(Sample Data):

When you select values from the dropdown list which only include the "FM" or "MC", the column "HCFNumber" will show or it will hide, right?

If so, If you have two many values in the lineofBusiness mapped of the BusinessUnit, you can create an new cascading parameter "BusinessUnit" based on the BusinessUnit field like below:

select  distinct a.BusinessUnit from (select  'MCCL' lineofBusiness, 'MC'  BusinessUnit ,11 HCFANumber
union 
select  'MCCS' lineofBusiness, 'MC'  BusinessUnit ,11 HCFANumber
union
select  'COLG' lineofBusiness, 'CO'  BusinessUnit ,11 HCFANumber
union
select  'COSM' lineofBusiness, 'CO'  BusinessUnit ,22 HCFANumber
union 
select  'FMMS' lineofBusiness, 'FM'  BusinessUnit ,33 HCFANumber
union 
select  'FMCG' lineofBusiness, 'FM'  BusinessUnit ,44  HCFANumber)a
where lineofBusiness in (@LineofBusiness)

Add another filter in the (@BusinessUnit) and use expression below on the column visibility:
=IIF(Join(Parameters!BusinessUnit.Value,",")="FM" or Join(Parameters!BusinessUnit.Value,",")="MC" or Join(Parameters!BusinessUnit.Value,",")="FM,MC" , false,true)

Preview like below:

If you still have any problem, please try to provide more details information about the expect result you want to get based on the show/hide.

Regards,
Vicky Liu

April 26th, 2015 11:52pm

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

Other recent topics Other recent topics