I have a Block chart with two Cyclic groups conditionally enabled so that only one will be enabled based on a condition.
To my surprise, if the expression returns no value, both the Groups are coming up.
If it has data, it works fine.
It also works as expected for other charts.
Change the condition in dimension tab
For New Group
For New Group1
Also in your example there is no value for Stock... You can change to Sum(Sales) as an expression
Issue occurs only when there is no value.
If I change it to Sum(Sales), there's no issue.
And it doesn't work even when GetFieldSelections(Test)=1 or 2
Looking at your attached file. Your script don't have value for Stocks, populate Stocks in the script reload and your expression will work. With the Enable Conditions (Dimensions) for value in Field Test, use this
if(GetFieldSelections(Test)=1,1,0) // For Test = 1
if(GetFieldSelections(Test)=2,1,0) // For Test = 2
This should get you what you want.
That's where I started. My Stock has no value and only then this issue arises. For example, there is no stock and so I can't populate stock.
My very first question says
" To my surprise, if the expression returns no value, both the Groups are coming up."