Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Visibility with multi-value parameters
lgudait
Hello,
I currently have a report where I want to display different tables depending on the parameter values the user selects.
In the example I created out of classic models, I want visibility on for the first table when the status 'Shipped' is selected (either by itself or with any other status). Otherwise, I want the second table to display (and the first table hidden). Help please!
Find more posts tagged with
Comments
lgudait
Whoops - here is the attachment
Tubal
Put something like this in your visibility script for the table:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var shipped = "nope";
for(var i=0; i<params["prm_OrderStatus"].length; i++) {
var status = params["prm_OrderStatus"].value[i];
if (status == "Shipped") {
shipped = "yup";
}
}
shipped=="nope";</pre>
<br />
Basically, you're telling it to be invisible whenever shipped = "nope". So you iterate through your parameter, and if you find "Shipped" you change shipped to "yup". Since shipped isn't "nope" anymore, then the table will now be visible.
lgudait
This worked perfectly - thanks!