Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ingoniclas
Creator II
Creator II

'Include' the same expression in different table chart columns w different outcomes

Hi there,

 

I want to use the same expression in a table chart in 2 different columns. In column 1 I want to multiply with 'actual sales', in column 2 I want to multiply with 'planned sales'. Since I need to adapt the script quite often, I don't want to make the same changes in both columns all the time. So I was thinking of pulling in the expression with an include command into both columns, and then use one of 2 possible approaches I came up with:

1) Using a variable which would translate into 'actual sales' in column 1, and 'planned sales' in column 2. But how? Can I define variables within the table chart expression?

2) If I could refer to the column by column no. or column label, I could use an additional  if, then, else expression which would then use either 'actual sales' or 'planned sales' according to the recognized column. But so far I couldn't come up with a working solution. Note: This is a straight table, not a pivot table.

 

Thanks for any suggestions.

 

Best,

Ingo

Labels (3)
2 Replies
rpennacchi
Contributor III
Contributor III

You can create a variable on your script like this:

let vExpression_Example = 'sum(Value)';

And create a measure on your table chart with the measure: 

$(vExpression_Example)

Or you can create a Master Measure for each expression.

 

I am not quite sure if I understood your problem. Let me know if this helps you out or if this is not what you want, send some data sample please with what you have and what you expect.

Find me on linkedin:
https://www.linkedin.com/in/rodrigo-pennacchi/
ingoniclas
Creator II
Creator II
Author

Hi rpennacchi,

thanks for your reply. Unfortunatley, It's not quite that easy.  Let me try to illustrate it below. The major expression is the same in both columns.  So I could use a Master Measure for this, agreed. But how to fit in the Planned sales or Actual sales, respectively? When I define variables in the script as you suggested, the value of the variable would be the same for both columns, either Planned sales or Actual sales. That's the problem.

Bild1.jpg