Here aremore details onmy problem : I have a master calendar with about 100 fields.
In a table, i have to display the price for the current month, the price for the next month and the price for the previous month.
My table must be independant from selections on a week, a commercial event, a particular day.
I currently create dynamically a set analysis with all the fields of my calendar except the month, but in order to ameliorate my formula Iwould like to haveonlythe calendar fieldspresent in activeselections.
So, If I understand you correctly you want a string that's a list of the fields in which selections are made?
Well, one way is to create a variable per field that returns the field name if there are selections in the field. Then concatenate all those variables into one string. The variables can be generated in the script:
SET _vFList ='';
FOR i = 0 to NoOfTables()-1;
LET vTable = TableName($(i));
FOR j = 0 to NoOfFields('$(vTable)')-1;
SET _v$(vVarName) = =if(getselectedcount([$(vField)]),'$(vField),');
SET _vFList = $(_vFList) & _v$(vVarName);
LET _vFList = right('$(_vFList)',len('$(_vFList)')-1 );
The last variable _vFList should return the list of fields when you dollar-expand it in a sheet object: $(_vFList). See attached example.
There may be an easier way, but I haven't found it yet. Maybe a real pro knows how to do this more efficiently.
I had the same issue and could find a good solution. So I ended in listing all my fields (automatically through variables of course ;-) ) and, to my surprise, the performance was still very good, event with 100 fields.
But I'd love to have a proper answer on this too !