
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
