Help

Insert Dynamic Value Through Variable In Formula

Solved
Jump to Solution
1636 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Rohit_Kumar
4 - Data Explorer
4 - Data Explorer

Hi Team,
I wants to insert the dynamic value through variable in formula.
eg: filterByFormula: “IS_AFTER({Time-stamp}, dateValue)”

Here dateValue is a variable that gives error. but if i use the string instead variable it works . Also variable is type of string . Please suggest the best way to insert the variable value in formula.

1 Solution

Accepted Solutions
Zollie
10 - Mercury
10 - Mercury

To fix your formula, dateValue needs to be replaced with a value that is a datetime type. That could look like:

IS_AFTER({Time-stamp}, {Some Other Date Column})

Or if the value is the same for every row, you could use DATESTR (which converts a properly formatted string to datetime):

IS_AFTER({Time-stamp}, DATESTR("2015-11-12"))

Also it seems odd to me to see the words variable and formula in the same sentence. I’m tempted to say formulas don’t have variables, but I suppose a {column name} is a variable since it’s a dynamic value. But I can’t, for example, pick a word that only exists in a formula and assign it a value (as a language like JavaScript would allow).

See Solution in Thread

1 Reply 1
Zollie
10 - Mercury
10 - Mercury

To fix your formula, dateValue needs to be replaced with a value that is a datetime type. That could look like:

IS_AFTER({Time-stamp}, {Some Other Date Column})

Or if the value is the same for every row, you could use DATESTR (which converts a properly formatted string to datetime):

IS_AFTER({Time-stamp}, DATESTR("2015-11-12"))

Also it seems odd to me to see the words variable and formula in the same sentence. I’m tempted to say formulas don’t have variables, but I suppose a {column name} is a variable since it’s a dynamic value. But I can’t, for example, pick a word that only exists in a formula and assign it a value (as a language like JavaScript would allow).