Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In Thread How to use a parameter in a variable to use an alternate state in set analysis I ask a question about using alternate states in variables. This question is answered and it is working for named alternate states:
The following syntax ist working:
set fTotalDuration=(sum({$1} Duration)
In the diagrams you can use the formular like =$(fTotalDuration('Machine1')).
'Machine1' is the defined alternate state.
But now I face the problem that I cannot use this formula with inherited alternate states.
That means instead of using the named alternate state 'Machine1'
I want to use the alternate state <inherited>.
So far I could not find any possibility to use <inherited> as parameter. I tried the following combinations:
So the final question remains: How can 'inherited' be used for an alternate state in a variable?
Regards
Dirk
Dear Stefan,
according to you explanation this will work then:
Instead of
set fTotalDuration= sum({$1} Duration)
I should use:
set fTotalDuration= if(len($1)>0, sum({$1} Duration), sum(Duration))
So the correct syntax with this formula is then:
=$(fTotalDuration('Machine1'), when using alternate state Machine1
and
= $(fTotalDuration(''), when using the inherited state.
You are absolutely right, I have to ensure the right syntax in the variables. For me this was not an obvious solution.
Thanks for your help.
Dirk
How about this
=$(fTotalDuration(Chr(36)))
Dear Sunny,
thanks for you answer, but this doesn't work.
Regards
Dirk
Tried this and it worked for me
=$(fTotalDuration('$'))
and also this
=$(fTotalDuration($(=Chr(36))))
AFAIK, the dollar sign denotes the default state, not inherited state.
Inherited state would be a void set identifier, i.e.
// default set
Sum( {$<Field = {'A'}>} Value)
vs.
// inherited set
Sum( {<Field = {'A'}>} Value)
But seems to be working with selection in inherited state.... for what I have seen, I have never seen difference between Inherited state and default state. There may be some difference, but don't think it is $
Selection in Inherited and Default state list box go hands in hand....
Seems like you inherited from default state...
Try using an alternate state in your sheet properties, then the text object will inherit from that.
Dear Sunny,
both do not work, see attached file.
I forgot to mentioned, that sheet belongs to an alternate state 'Mac !hine 1'.
If you change this, then inherited won't work.
Regards
Dirk
Seems to work with
=$(fTotalDuration(<Field>))
// used Field as a dummy field to create a valid syntax, would be better to create another variable proper syntax to avoid this
Not sure I understand, would you be able to modify my script to show how inherited state and default state differ? I always thought they are the same thing, but might have always been mistaken