Total qualifier multiple fields within angle brackets < >
Hoping someone can help. I'm working on scripting an expression to calculation proportions within a pivot table. I know you can use the total qualifier as below to provide a sub-total related to a particular field. I also know you can have more than one field within the brackets. What I've done is allow the user to specify the field names and store them within a variable (as the pivot table acts as a custom report tool). This works fine when there are no spaces or special characters within the field names and you can have one or multiple field names. However, when there are spaces or special characters present, it will only accept a single field name with the variable also wrapped in double quotes e.g. "$(vDenomAppsOffers)".
Expression to populate vDenomAppsOffers (counts how many fields have been selected and then adds the chosen field names (which have been stored in the variables vNewFieldx). Where more than two fields are bring displayed in the table, the two right most field names are to be added.:
=if(vFieldCounter<2,'Session',if(vNewField4<>'Click to select a field',"vNewField3"&','&"vNewField4",if(vNewField3<>'Click to select a field',"vNewField2"&','&"vNewField3",if(vNewField2<>'Click to select a field',"vNewField2","vNewField1"))))
Proportion expression (counts all the conditional and unconditional offers and divides them by the total conditional and unconditional offers, subtotalled by the specified fields:
Re: Total qualifier multiple fields within angle brackets < >
Hi, vDenomAppsOffers is meant to display the field name (or names <field1>,<field2>). When I created a text object and made it equal to =vDenomAppsOffers it does this fine. But like I said, the table doesn't like fields with spaces or special characters. I tried adding the square brackets to the 'Set' button which the user clicks on to add their chosen field to the table (Action > Set Variable > vNewField1 =[$Field]) but that hasn't made any difference unfortunately.