I'm not sure I understand what you're after.
If you want a dynamic table with expressions that can be selected from a separate list, have a look at the following example.
SelectFieldsToDisplay.qvw 156.2 K
I don't understand why you can't use a Current Selections Box object. But if you want an alternative have a look at the attached example.
comm95706.qvw 211.8 K
Thank you for your response.
Here are more details on my 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 I would like to have only the calendar fields present in active selections.
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.
comm95706.qvw 221.8 K