Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
robin_heijt
Creator
Creator

Today () not showing date when loaded in Data load editor

Hi,

I am using the following bit in my data load editor:

LOAD *,
  Date("Hiring Date" + IterNo() - 1) as ActiveDate,
  MonthName("Hiring Date" + IterNo() - 1) as ActiveMonthYear,
 Year(Date("Hiring Date" + IterNo() - 1)) as ActiveYear
While "Hiring Date" + IterNo() - 1 <= Alt("Leaving Date", Today());
LOAD
	[Global ID],
	[Pers.No.],
	[First name],
	Date(Date#([Hiring Dat], 'DD.MM.YYYY') ) AS [Hiring Date],
Date(if(len([Leaving Da])<1,date(today()),Date(Date#([Leaving Da], 'DD.MM.YYYY')))) AS [Leaving Date]

What I want to achieve is, when "Leaving DA" is blank, then return today's date.

When I load this from the expression editor with:

=if(len([Leaving Date])<1,today(),Date(Date#([Leaving Date])))

Then everything is fine. But when loaded from the Data load editor, it returns a null value:

Active in.pngWhat am I doing wrong here?

Labels (1)
  • today

2 Replies
marcus_sommer

You could try it with len(trim([Leaving DA])) to check if there are no dates or maybe just doing the check with alt(), like:

alt(Date(Date#([Leaving Da], 'DD.MM.YYYY')),
    date(today()))

- Marcus

Anonymous
Not applicable

try:

LOAD *,
Date("Hiring Date" + IterNo() - 1) as ActiveDate,
MonthName("Hiring Date" + IterNo() - 1) as ActiveMonthYear,
Year(Date("Hiring Date" + IterNo() - 1)) as ActiveYear
While "Hiring Date" + IterNo() - 1 <= Alt("Leaving Date", Today());
LOAD
[Global ID],
[Pers.No.],
[First name],
Date(Date#([Hiring Dat], 'DD.MM.YYYY') ) AS [Hiring Date],
if(len([Leaving Date])<1,today(),Date(Date#([Leaving Date]))) As [Leaving Date]