Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Conditional Inline Mapping in Load Script?

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'
]

;

1 Solution

Accepted Solutions
Not applicable

Re: Conditional Inline Mapping in Load Script?

try something like this:

Load *,If(add_date>Today()-14,1,0) as idle_request;

SQL SELECT * FROM TABLEX;

Kiran.

7 Replies
Not applicable

Re: Conditional Inline Mapping in Load Script?

Would an if statement not work rather than an inline?

If(add_date>Today()-14,1,0)

Not applicable

Re: Conditional Inline Mapping in Load Script?

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.

Not applicable

Re: Conditional Inline Mapping in Load Script?

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.

Not applicable

Re: Conditional Inline Mapping in Load Script?

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.

Not applicable

Re: Conditional Inline Mapping in Load Script?

Since we're looking for dates that are 14 days old, add_date needs to be compared to today's date.

Not applicable

Re: Conditional Inline Mapping in Load Script?

try something like this:

Load *,If(add_date>Today()-14,1,0) as idle_request;

SQL SELECT * FROM TABLEX;

Kiran.

Not applicable

Re: Conditional Inline Mapping in Load Script?

This worked, Kiran, thanks.