Sorry, went a bit quick then, but this works, notice the different use of LET & SET, in this case you need to use SET as you don't want the expression to be immediately evaluated at that time,
LOAD * INLINE [
RecordID, IncidentDate, Value
1, 01/01/2001, 100
2, 05/02/2001, 154
3, 12/03/2002, 200
4, 09/08/2004, 53
Let vNoOfRows = NoOfRows('IncidentTemp');
FOR i=0 to $(vNoOfRows)-1
LOAD IF(ISNULL($(vRecordID)),'NULL'&$(i),$(vRecordID)) as vrid
, IF(ISNULL($(vIncidentDate)),'NULL'&$(i),$(vIncidentDate)) as vlDate AutoGenerate(1);
Thank you very much. It works perfectly.
Just out of my curiosity, when I used "let" instead of "set", the data that I will get in TestReplicate table will be:
vrid vlDate 1 0.00049975 2 0.001249375 3 0.001998002 4 0.000561377
Where are those numbers for "vIDate" coming from? They are not timestamps of original "IncidentDate". In addition, it seems "let" works well for ID column and Value column. Only for "IncidentDate" column, it needs to be changed to "set". Do you know why?
I'm not sure why it would be different for SET & LET in the above case, it certainly shouldn't be.
Having said that, QlikView does do very odd things with dates, you will find that by far the best way to avoid date issues is to convert them to numbers in the load script and then use date functions in your charts to show what you want. This always makes things easier if you want to create expressions and/or dimensions based around dates.
So, for you date, in the load script you should propbably do something like vlDate = NUM(IncidentDate).
Then, in your charts, you should convert them back to date formats using something like Date(vlDate,'DD/MM/YYYY')