Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Auto Prioritization in Chart?

I have a whopper of a problem here. I've been requested to have QlikView automatically assign priority levels in real-time, depending on the submit_date field. If a request was submitted more than 14 days ago, its priority needs to be elevated a level (LOW to STANDARD to CRITICAL). Here's the fields from the database itself:

  • priority_name (critical, low, high)
  • system_name (A, B, C, D, E, F, G)

Here's the inline table I had to create for the original TaskPriority table/chart :

TaskPriority:

LOAD

    TaskPriority,

AutoNumber(priority_name & '-' & system_name) as priorityKey;

LOAD * INLINE [

    priority_name, system_name, TaskPriority

    Critical, A, 1

    Critical, B, 2

    Critical, C, 3

    Critical, D, 4

    Critical, E, 5   

    Critical, F, 6

    Critical, G, 7

    Standard, A, 8

    Standard, B, 9

    Standard, C, 10

    Standard, D, 11

    Standard, E, 12

    Standard, F, 13

    Standard, G, 14

   ];

This works fine. For the auto prioritization, I tried implementing a "flag" in the load statement:

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

...and then I tried implementing the following change to the inline table:

TaskPriority:
LOAD
    TaskPriority,
AutoNumber(priority_name & '-' & system_name) as priorityKey;
LOAD * INLINE [
    priority_name, system_name, idle_request, TaskPriority
Critical, A, 0, 1
Critical, B, 0, 2
Critical, C, 0, 3
Critical, D, 0, 4
Critical, E, 0, 5
Critical, F, 0, 6
Critical, G, 0, 7
Standard, A, 0, 8
Standard, B, 0, 9
Standard, C, 0, 10
Standard, D, 0, 11
Standard, E, 0, 12
Standard, F, 0, 13
Standard, G, 0, 14
Low, A, 0, 15
Low, B, 0, 16
Low, C, 0, 17
Low, D, 0, 18
Low, E, 0, 19
Low, F, 0, 20
Low, G, 0, 21
Critical, A, 1, 8
Critical, B, 1, 9
Critical, C, 1, 10
Critical, D, 1, 11
Critical, E, 1, 12
Critical, F, 1, 13
Critical, G, 1, 14
Standard, A, 1, 15
Standard, B, 1, 16
Standard, C, 1, 17
Standard, D, 1, 18
Standard, E, 1, 19
Standard, F, 1, 20
Standard, G, 1, 21
Low, A, 1, 22
Low, B, 1, 23
Low, C, 1, 24
Low, D, 1, 25
Low, E, 1, 26
Low, F, 1, 27
Low, G, 1, 28
   ];

But this gives me duplicate entries, like a request will be a TaskPriority value of both 2 AND 23. Given the task at hand, am I approaching this the wrong way? Any suggestions would help. Thank you all very much, this great community has never let me down before.

Community Browser