Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field "add_date", which is a timestamp field in the database (date/time). Is there a way to create an inline table that designates any date older than 14 days as "Past Due" and those that are not as "On Track"?
Something along the lines of this for a true/false field, maybe?
LOAD
* INLINE
[
add_date, idle_request
'{>Today()-14}','1'
'{<Today()-14}','0'
]
;
try something like this:
Load *,If(add_date>Today()-14,1,0) as idle_request;
SQL SELECT * FROM TABLEX;
Kiran.
Would an if statement not work rather than an inline?
If(add_date>Today()-14,1,0)
ALSO - if anyone can help me inject this condition into my existing inline table (which is used as an artificial means to sort priority), that'd be even better:
TaskPriority:
LOAD
TaskPriority,
AutoNumber(priority_name & '-' & system_name) as priorityKey;
LOAD * INLINE [
priority_name, system_name, TaskPriority
Critical, 'System Name 1', 1
Critical, 'System Name 2', 2
Critical, 'System Name 3', 3
Standard, 'System Name 1', 4
Standard, 'System Name 2', 5
Standard, 'System Name 3', 6
];
The "stale" requests would need to appear on top when sorted by task priority.
I'm not sure an if statement would work, since I need an actual field indicating whether or not a request is older than 14 days.
What should add_date be compared with? If it should compare with the day document is reloaded then Felim Shanaghy, suggesion will work as it creates a flag field in the data model.
Kiran.
Since we're looking for dates that are 14 days old, add_date needs to be compared to today's date.
try something like this:
Load *,If(add_date>Today()-14,1,0) as idle_request;
SQL SELECT * FROM TABLEX;
Kiran.
This worked, Kiran, thanks.