Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

script to rename a field

Hi folks,

I have a spreadsheet with two different date columns. One is called BookDate, the other is InvoiceDate. I am creating a new field BookActionYear= Year(BookDate) but when BookDate is null, BookActionYear=Year(InvoiceDate).

Could you help me with the script please...?

1 Solution

Accepted Solutions
srchilukoori
Specialist
Specialist

Massimo Grossi is correct. just a small change.


IF(len(trim(BookDate))=0,   Year(InvoiceDate),    Year(BookDate)) As BookActionYear;


SC

View solution in original post

2 Replies
maxgro
MVP
MVP

if(len(trim(BookDate))=0,   InvoiceDate,    BookDate) as BookActionYear

srchilukoori
Specialist
Specialist

Massimo Grossi is correct. just a small change.


IF(len(trim(BookDate))=0,   Year(InvoiceDate),    Year(BookDate)) As BookActionYear;


SC