Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if in load script with several fields

Hi to all,

I have 2 tables ( A and B ). In the table A there is a date field "date1". In the table B there is another date field "date2".

I need, in the load script, to calculate an integer field that is the working days from date1 to date 2 or from date2 to date1,

I dont know which is the smallest date.

I tried to put an if

...

...

...

Table_B

Select

A,

B,

Date2

FROM Table_from_system

LOAD

If( Date1<Date2,NetWorkDays(Date1, Date2),'-' & NetWorkDays(Date2,Date1)) as Delay;

But clearly doesn't work because the system doesn't find the Date1 Field.

Thanks a lot

2 Replies
Gysbert_Wassenaar

You first need to join (or concatenate) table A and B. Then you can use the joined table for your calculation since it will then contain both Date1 and Date2.


talk is cheap, supply exceeds demand
Not applicable
Author

Unlikely I don't have common fields between this two tables. I can't join them.