Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is there any way to use the contents of a variable as a field name in an expression?
What I am wanting to do is have one pivot table but make it so that the value displayed can be chosen from a list if fields which would be input into the variable and summed. I have some 10 fields that users want to see in the table.
The reason I cannot just add all of these fields into the table is because the table is a grid of values that show the amount of money that has moved from one category to another over two periods. So my choices currently are to make nested IFs in the expressions (which I have found is too slow to calculate for the amount of data I have, or to make separate tables for each value field.
Below is an example of what the grid looks like if you are having trouble picturing what I mean. Over the x-axis is the first period that a user has chosen and the y-axis is the second period.
If figured this out by the way if anyone is interested.
Basically say I want users to be able to choose to see EAD or RWA values in the table. I then have two fields VALUE_EAD and VALUE_RWA which contain these values.
I then create a variable during load called ACTIVE_VALUE. I make an input box with a drop down in which you can only select either 'EAD' or 'RWA'.
In my expression I then use the following to refer to the field that I want to display the values of:
=SUM( $(='[' & 'VALUE_' & '$(ACTIVE_VALUE)' & ']') )