Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional variable

Hi,

is it possible to create a variable that has two possible outcome?.

For example, I want this statement to be held by one variable:

if OPEN_DATE ('DD/MM/YYYY') <  '01/06/2007' then A otherwise B

if not what could be the best way to go about this rather than created a field on the script?

1 Solution

Accepted Solutions
patroser
Partner - Creator
Partner - Creator

You could add a paramter to your variable.

Assign this to your variable:

If( Max($1) < '01/06/2007' ,'A','B')


calling the variable like:

$(vCheckDate(OPEN_DATE))

or

$(vCheckDate(CLOSE_DATE))

and so forth


in case you want to calculate it row-based don't keep the equal sign, otherwise keep it in the variable

hope this helps

Patrick


View solution in original post

3 Replies
hic
Former Employee
Former Employee

You can assign a formula to a variable, e.g.

=If( Max(OPEN_DATE) < '01/06/2007' ,'A','B')

(This assumes that OPEN_DATE has 'DD/MM/YYYY' as format and that the default format is the same).

Just make sure that the variable definition starts with an equals sign. See The Magic of Variables

HIC

Anonymous
Not applicable
Author

Hi,

The issue in making it a filed in the table (your method) is I will have to use it 4 times from 3 difference sources. therefore I have to 'rename' this field 4 times rather than calling it once.

Hence I want to know is the way of making it a variable with two possible outcomes rather

patroser
Partner - Creator
Partner - Creator

You could add a paramter to your variable.

Assign this to your variable:

If( Max($1) < '01/06/2007' ,'A','B')


calling the variable like:

$(vCheckDate(OPEN_DATE))

or

$(vCheckDate(CLOSE_DATE))

and so forth


in case you want to calculate it row-based don't keep the equal sign, otherwise keep it in the variable

hope this helps

Patrick