Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
last weekend I was tired of the intensive use of variables for expressions, dimensions, comments and tiles in my charts so I was thinking about how to reduce them. I finally tried something warea storing the values in arrays and using subfield() commands in the charts to select the proper variable. The idea was as follows.
definition of the variable:
SET vSales = ('Total Sales';'Sales';sum(sales);'total sales per...')
in the charts I would then use a subfield command for selecting the proper content:
subfiled($(vSales),';',1) for title
subfiled($(vSales),';',2) for expr text
subfiled($(vSales),';',3) for expr formula
subfiled($(vSales),';',4) for expr comment
what am I doing wrong here? ESpecially the formula does not work.
Thanks to Marcus Sommer the working commands for the formula look like follows:
= $ (= subfield ( vSales , ' ; ' , 2) or
= $ (= subfield ( ' $(vSales) ' , ' ; ' , 2)
Try it with quotes and/or dollar-expansion:
= $(=subfield($(vSales), ',', 3))
= subfield('$(vSales)', ',', 3)
- Marcus
Hi,
Try like this
SET vSales = 'Total Sales;Sales;sum(sales);total sales per...';
let vTotalSales = subfield('$(vSales)',';',1) ;
let vSales = subfield('$(vSales)',';',2) ;
let vSumSales = subfield('$(vSales)',';',3) ;
Regards,
Jagan.
Thanks, but this was exactly the target --> avoidance of too many variables in order to keep them manageable
Thanks to Marcus Sommer the working commands for the formula look like follows:
= $ (= subfield ( vSales , ' ; ' , 2) or
= $ (= subfield ( ' $(vSales) ' , ' ; ' , 2)