Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Peter_Cammaert
Partner - Champion III
Partner - Champion III

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
Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishsaggi
Champion III
Champion III

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;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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

Not applicable
Author

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

Thanks again

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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.