Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
Not applicable

Limit results in a new field in my script

HI

I have added a new field in my script  (days_overdue) , I wanting to limit the results so that it only show number of days over '0'.

This is my script so far:

LOAD [Person Ref],

     [Child Name],

     DoB,

     Gender,

     Ethnicity,

     Disability,

     [Legal Status],

     [Lead Professional],

     Team,

     [Start Date],

     [End Date],

     [Target Date],

     [Target Date Amended?],

     [Due Within 5 Days?],

     num(today()-[Target Date]) as days_overdue,

     Overdue?

FROM

1 Solution

Accepted Solutions

Re: Limit results in a new field in my script

I guess you don't want to know about invoices that aren't overdue in a field that shows the number of days overdue? Then you could use a minor expression modification that removes all negative days_overdue values:

:

max(num(today()-[Target Date]), 0) as days_overdue,

:


Best,


Peter

View solution in original post

5 Replies

Re: Limit results in a new field in my script

You could arrange all date formats is same. Then only it works. Even, Don't require to use Num() here

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
vishsaggi
Esteemed Contributor III

Re: Limit results in a new field in my script

May be this? Do a preceding load.

LOAD *

WHERE days_overdue > 0;

LOAD [Person Ref],

     [Child Name],

     DoB,

     Gender,

     Ethnicity,

     Disability,

     [Legal Status],

     [Lead Professional],

     Team,

     [Start Date],

     [End Date],

     [Target Date],

     [Target Date Amended?],

     [Due Within 5 Days?],

     num(today()-[Target Date]) as days_overdue

    

FROM YoursourceTable;

Re: Limit results in a new field in my script

I guess you don't want to know about invoices that aren't overdue in a field that shows the number of days overdue? Then you could use a minor expression modification that removes all negative days_overdue values:

:

max(num(today()-[Target Date]), 0) as days_overdue,

:


Best,


Peter

View solution in original post

Not applicable

Re: Limit results in a new field in my script

Thank you everyone who has replied to me, my script now works.

Thanks again

Re: Limit results in a new field in my script

If your problem has been solved, please close the discussion by marking reponses as HelpFul and Correct. That way, other community members will know that there is a solution to be found here to a problem they may have encountered themselves.

Thanks.