Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filling blank fields with dates

People, I have a problem in my database that I have a field called "[Claim Closed Date]", that sometimes it comes blank for me. I would like to create a rule for that, this rule has to be like this: I have another field called "[Status Claim]" and another one called "[Submitted Date]", so, I would like to put like this in the script:

...

[Claim Closed Date],

[Status Claim],

[Submitted Date],

....

if([Claim Closed Date] = "Blank (?)" and [Status Claim] = 'Closed', FILL WITH [Submitted Date] + "30 days",,)

how do I do such thing in the script??

14 Replies
Anonymous
Not applicable
Author

Julio

Also could you try it with the suggestion of maxgro

if( len(trim( [Claim Closed Date] ))=0 and [Status Claim] = 'Closed', date( [Submitted Date] + 30 ) as [Claim Closed Date] ,


Mine is searching for Null's, but Massimo's is searching for where the string has length of zero having trimmed of leading & trailing spaces. - which may well be what you need.



Not applicable
Author

Thank you Bill, alot!!!!

Not applicable
Author

Guys, sorry, my mistake, it did not worked correctly. It brought only the ones that were in blank before, not everything... my script is:

eParts:

LOAD [Claim #],

     [Work Order #],

     [Aircraft Model],

     [Serial Number],

     Operator,

     [Shop Name]  as [Shop Name Claim],

     [Shop Code],

     [Claim Opened Date],

     //([Claim Close Date]),

     [Arrival Date],

     [Service Complete Date],

     [A/C Flight Hours],

     [A/C Cycle],

     Currency,

     [Claim Total],

     [Total Approved],

     [Total Denied],

     [Status Claim],

     [Total Scheduled Labor],

     [Total Unscheduled Labor],

     [Total Service Bulletin Labor],

     [Total Other Labor],

     [Expendable Parts],

     [Total Handling Fee],

     [Total Freight],

     [Total Miscellaneous],

     PAYER,

     [Notification #],

     [Service Order #],

     [Purchase Requisition #],

     [PO #],

     [PO Date],

     //Comments as Comments_eParts,

     [PO Total],

     [Squawk Item],

     [Ref. Item],

     Type,

     Status,

     Date,

     [Squawk Total],

     [Failure Date],

     [Type (Inspection)],

     [Source / Discrepancy],

     [Description / Corrective Action],

     [Man Hours],

     [Labor Rate],

     [Labor History],

    // [Approved? Y / N],

    // Comment as Comment_eParts,

     Classification,

     PO#,

     [PN Installed],

     [PN Installed Description],

     [S/N Installed],

     Qty,

     [Unit of Measure],

     [Your Price],

     [List Price],

     [Handling Fee],

     [Total Handlling],

     [CAP / Freight],

     [PN Removed],

     [SN Removed],

  //   [Approved? Y / N],

   //  Comment as Comment1_eParts,

     Freight,

     [Freigh Total],

    // [Approved? Y / N],

    // Comments as Comments1_eParts,

     Description,

     //[Total Miscellaneous],

   //  [Approved? Y/N],

    // Comment as Comment2_eParts,

     [Total Amount],

     [Sales Org.],

    

     if( len(trim([Claim Close Date]))=0 and [Status Claim] = 'Closed', date( [Claim Opened Date] + 60,[Claim Close Date])) as [Claim Close Date],

    

     

  IF([Labor Rate]>200,[Labor Rate],) as Wrong_Labor_Rates,

  Month([Claim Close Date]) as MONTH,

  Year([Claim Close Date]) as YEAR,

  Day([Claim Close Date]) as DAY,

  FileName() as DATA_SOURCE,

  IF([Claim #]=PREVIOUS([Claim #]),'0','1') as UNIQUE_FLAG

    

FROM

C:\Users\jcloure\Desktop\Feedbackserver_Qlikview\CLAIM_2013_27012014092318.csv

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

Anonymous
Not applicable
Author

Julio

I think you had a misplace bracket, try this.

    if( len(trim([Claim Close Date]))=0 and [Status Claim] = 'Closed', date( [Claim Opened Date] + 60 ) ,[Claim Close Date]) as [Claim Close Date],


Red ) added & second ) before as removed so leaving just one )



Best Regards,     Bill

Not applicable
Author

Thanks Bill, now worked perfectly. I got another problem here with that, but that is in my process, just what I wanted to see exactly

Thank you ALOT!