Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data Loader If Statement

Hi,

I am trying to load data from an access data table where I want to check two date fields (dteMultipleYearEndDate and Contract_End_To). If the dteMultipleYearEndDate isnull then I want to load the Contract_End_To date instead as EndDate

I am trying to do this in the data loader as I want to then use a derive on the EndDate to give me date time fields in Qliksense Desktop.

I have tried this code but receive a script error:

if 'dteMultipleYearEndDate' isnull then Load [Contract Date to] as [EndDate] from `TblProviderInformation Query9`; else Load [dteMultipleYearsEndDate] as [EndDate] from `TblProviderInformation Query9`; endif

I have also tried:

if 'dteMultipleYearEndDate' isnull then Load [Contract Date to] as [EndDate] from `TblProviderInformation Query9` else Load [dteMultipleYearsEndDate] as [EndDate] from `TblProviderInformation Query9` endif

I can not seem to find any information to indicate if an IF statement can even be used in the data loader. Qliksense provides expresison guidance on the if statement but I am not sure if that means it can be used in the data loader or is just standard guidance you would receive in a expression builder for functions / master items.

Help would be greatly appreciated.

Cheers

David

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

You can use:

     =Alt(dteMultipleYearEndDate, Contract_End_To)

Alt is like the SQL COALSESCE or ISNULL commands, except that it returns the first valid numeric. Dates are numerics, but nulls are not.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

t1.png

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sasiparupudi1
Master III
Master III

try

if (isnull(dteMultipleYearEndDate) ,[Contract Date to],dteMultipleYearEndDate) as [EndDate]

hth

Sasi