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: 
akpofureenughwu
Creator III
Creator III

How to create a date field from another date field

Hello everyone, I need assistance on a QV work.

I have a field on a QVD file and I am requested to create  another field date from the existing date field

in this relationship, New Date = 45 days + Posting date

Thanks

Please find the attached file.

24 Replies
akpofureenughwu
Creator III
Creator III
Author

Thanks Man... The Due Date field is empty. Please can u review the script so we can try it again?

Thanks

sunny_talwar

Did you make all these changed my friend?

LOAD *,

    Day & ' ' & Month as _Month;

LOAD *,

    Match(Quarter,'Q1','Q2','Q3','Q4') as Quar;

LOAD *,

    Month(Date) as Month,

    WeekDay(Date) as WeekDay,

    'Week ' & Week(Date) as Week,

    Year(Date) as Year,

    'Q'& Ceil(Month(Date)/3) as Quarter,

    'Day '& Day(Date) as Day,

    Day(Date) as nDay;

LOAD *,

    Date(PostingDate + 45) as DueDate;

LOAD [Account type - Account type Level 01 (Key)],

    [Account type - Account type Level 01 (Text)] as [Account Type],

    [Chart of accounts - Chart of accounts Level 01 (Key)],

    [Chart of accounts - Chart of accounts Level 01 (Text)] as [Chart of accounts],

    [G/L Account - G/L Account Level 01 (Key)],

    [G/L Account - G/L Account Level 01 (Text)] as [G/L Account],

    [Base Date - Base Date Level 01 (Key)],

    [Base Date - Base Date Level 01 (Text)] as [Base Date],

    [Net due date - Net due date Level 01 (Key)],

    Date(Date#([Net due date - Net due date Level 01 (Text)], 'DD.MM.YYYY'), 'DD-MM-YYYY') as [Date],

    [Company code - Company code Level 01 (Key)],

    [Company code - Company code Level 01 (Text)] as [Company Code],

    [Vendor - Vendor Level 01 (Key)],

    [Vendor - Vendor Level 01 (Text)] as [Vendor],

    [Document Date - Document Date Level 01 (Key)],

    [Document Date - Document Date Level 01 (Text)] as [Document Date],

    [Document type - Document type Level 01 (Key)],

    [Document type - Document type Level 01 (Text)] as [Document Type],

    [Item - Item Level 01 (Key)],

    [Item - Item Level 01 (Text)],

    [Document no. - Document no. Level 01 (Key)],

    [Document no. - Document no. Level 01 (Text)] as [Document ID],

    [Item Text - Item Text Level 01 (Key)],

    [Item Text - Item Text Level 01 (Text)],

    [Posting date - Posting date Level 01 (Key)],

    Date(Date#([Posting date - Posting date Level 01 (Text)], 'DD.MM.YYYY'), 'DD-MM-YYYY') as [PostingDate],

    [Fiscal year/period - Fiscal year/period Level 01 (Key)],

    [Fiscal year/period - Fiscal year/period Level 01 (Text)] as [Fiscal Period],

    [Document currency - Document currency Level 01 (Key)],

    [Document currency - Document currency Level 01 (Text)] as [Document Currency],

    [Local currency - Local currency Level 01 (Key)],

    [Local currency - Local currency Level 01 (Text)],

    Amount,

    [Amount - Unit],

    [Credit amt in LC],

    [Credit amt in LC - Unit],

    [Debit amt in LC],

    [Debit amt in LC - Unit],

    [Debit/Credit Amount],

    [Debit/Credit Amount - Unit],

    [Discount base],

akpofureenughwu
Creator III
Creator III
Author

Hello Sunny, It gave me an error ... Date field  not found,.....

Can we try again? Thanks

sunny_talwar

Did you remove this from your script?

Date(Date#([Net due date - Net due date Level 01 (Text)], 'DD.MM.YYYY'), 'DD-MM-YYYY') as [Date],


Capture.PNG

akpofureenughwu
Creator III
Creator III
Author

Hello sunny, I didn't change the script.

Still not give me the due date field parameters.

sunny_talwar

Would you be able to share the log file?

akpofureenughwu
Creator III
Creator III
Author

I don't understand Mr Sunny. This issue is still on my desk.. Thanks so far

sunny_talwar

Check here to learn how to generate a log file

How to generate Log files in QV

akpofureenughwu
Creator III
Creator III
Author

I have followed the instructions on that link (generate log file). I was told that the log file will be in the same folder/ocation where the qvw file is but I didn't see anything there. More clues please

sunny_talwar

Did you reload the application after you enabled the log file?