Global Constants in Formulas

Gert1
New Member

Good day.

Maybe I am just tired, but I canโ€™t figure this out.
I have a Admin Sheet with 2 Columns.
CONSTANT and VALUE

3X_b_d_bdc3b8548e302cc21880105f2091c5aa5f3bc4a2.png

To use these in a formula to for instance calculate Price of a Product, I use
[COST]*(1+INDEX(ADMIN[VALUE],1))

So this โ€œINDEX(ADMIN[VALUE]โ€ refers to the value of the markup constant.

Is there a way to read these values into global constants to then be able to just write

[COST] * CONSTANTS[MARKUP] or something similar?

Thanks

Gert

0 4 316
4 REPLIES 4

First, your table doesnโ€™t have a key column. That shouldnโ€™t be a problem in this example but donโ€™t do that on production apps.
INDEX(ADMIN[VALUE], 1) should return .6

What do you mean by this?

The only way to achieve a โ€œglobal constantโ€ is a table with one row and refer to it as
INDEX(TABLE[COLUMN], 1) or (but less advisable) ANY(TABLE[COLUMN]) assuming that [COLUMN] holds the value you need

LOOKUP( "MARKUP" , "global-constants" , "constant" , "value")

Gert1
New Member

@Marc_Dillon @SkrOYC

I was hoping I missed a constant definition somewhere in the AppSheet platform.
If it was possible one would have been able to refer to the constant merely by itโ€™s name.
Both your suggested solutions would work, but I think INDEX(ADMIN[VALUE], 1) is the shortest to type and yes it returns 0.6.
Using these in many places it becomes a schlep to type and to remember the correct index to use.

Thanks

Gert

You did not, there is none.

Top Labels in this Space