Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
=if(not(isnull(only({[s_Hier_Comp2]} fieldA))),
aggr(only({<ASSET_CLASS=P({s_Hier_Comp1}) * P({s_Hier_Comp2})>} ASSET_CLASS), ASSET_CLASS),
aggr(only({<ASSET_CLASS=P({s_Hier_Comp3}) * P({s_Hier_Comp4})>} ASSET_CLASS), ASSET_CLASS)
)
I have the above statement in an expression for a list box.
I need to apply a union of 2 alternate(s) based on my if condition (if there is a value for fieldA.
There seems to be some syntax issues in this, need to re-structure my aggr/if
Gerry
change your "not" to 0
=if((isnull(only({[s_Hier_Comp2]} fieldA))) = 0
Trying to understand your requirement...
HI
Clever Anjos <span class="icon-status-icon icon-mvp" title="Mvp"></span> <span class="icon-status-icon icon-partner" title="Partner"></span> wrote:
Trying to understand your requirement...
Clever: I'm just trying to execute different aggr() clauses based on if there is a fieldA selected in my list box or not.
in that case use this
=if(getselectedcount([s_Hier_Comp2]) >0,
aggr(only({<ASSET_CLASS=P({s_Hier_Comp1}) * P({s_Hier_Comp2})>} ASSET_CLASS), ASSET_CLASS),
aggr(only({<ASSET_CLASS=P({s_Hier_Comp3}) * P({s_Hier_Comp4})>} ASSET_CLASS), ASSET_CLASS)
)
did not work, I suspect I have to combine the if within the aggr, but running into syntax structure issues, with building it correctly... 😞
you don't need to include the if in the aggr, I assumed you had already validated the expressions
the easiest way to identify to find if an field is selected is by using getfieldselections or getselectedcount
getselectedcount/getfieldselections does not seem to work with alternate states.
can you have multiple selections ? or only one ?
and the getselected does work if you set the object state to the same one as the field that you want looking at