News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Conditional Formulas to control Layer Visibility

Started by AlexHP, November 16, 2015, 09:12:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AlexHP

OK, I'm on the verge of blowing my brains out here so I hope someone can help me with this...  :o

As usual, it seems that Visio does not work with formulas the way you might expect. I have two layers that have similar conditions on them for visibility. I am referencing values which I placed into the Document Shapesheet so that it is common to all pages. Here are the two formulas I am using:

Layer #1:
=IF(AND(TheDoc!Prop.CompType>"0",TheDoc!Prop.UnitVoltage>"1",TheDoc!Prop.UnitCtrl="A"),1,0)

Layer @2:
=IF(AND(TheDoc!Prop.CompType>"0",TheDoc!Prop.UnitVoltage>"1",TheDoc!Prop.UnitCtrl="J"),1,0)

The problem appears to be with the Prop.UnitCtrl condition. It seems that because it is text (i.e. letter instead of number) that Visio is ignoring it whereas if I change it to a number I can get the condition to work. Now, before anyone says "Then just make it a number", I can't. The letter is part of a model number code string which has both numbers and letters in it and must remain as is. So, what the heck am I doing wrong or what the heck is Visio doing wrong... or both. Please help!!! Thank you.

Alex...

AlexHP

And, of course, right after I posted this question, I found an answer. And, also as is for Visio, it has to be done a "special" way. I turns out that I have to use STRSAME in order to compare text, or string, values. Therefore, my two formulas would be:

=IF(AND(TheDoc!Prop.CompType>"0",TheDoc!Prop.UnitVoltage>"1",STRSAME(TheDoc!Prop.UnitCtrl,"A")),1,0)

and

=IF(AND(TheDoc!Prop.CompType>"0",TheDoc!Prop.UnitVoltage>"1",STRSAME(TheDoc!Prop.UnitCtrl,"J")),1,0)

respectively. Of course. Why would it not be that way...  ???

Yacine

Yacine

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 184 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1052KB.
Tokens: post-login.
Cache hits: 13: 0.00150s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]