Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need help

Am applying the below code but i got empty fields in date field i want date so can u plzzz suggest me

find attachment

Calender:

LOAD CAD_Activity_ID,

     CAS_Date_Value,

     CAM_ID,

     CAS_Remarks,

     CAS_Status,

     CAS_Updated_By,

     if (CAS_Updated_Date = (CAS_Value_Type='A'), 'CAS_Updated_Date')as Date1,

     if (CAS_Updated_Date = (CAS_Value_Type='T'), 'CAS_Updated_Date')as Date2,

     if (CAS_Value_Type='A', 'A')as CAS_Value_Type1,

     if (CAS_Value_Type='T', 'T')as CAS_Value_Type2 ,

     CAS_Version

FROM

(qvd);

1 Solution

Accepted Solutions
bertdijks
Partner - Contributor III
Partner - Contributor III

I think your formula is not right:

   if (CAS_Updated_Date = (CAS_Value_Type='A'), 'CAS_Updated_Date')as Date1,

means:

if date field = true then give then return the date field.

Since the data field does not contain a true or false value it will never return the date.

You probably want to use the following expression:

if (CAS_Value_Type='A', CAS_Updated_Date)as date1

regards,

Bert

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

You are comparing:

CAS_Updated_Date  to a boolean value (0 or 1) resulting from the expression: CAS_Value_Type='A'


so if CAS_Updated_Date has a date format it will never be equal to 0 or 1

Hope it helps

bertdijks
Partner - Contributor III
Partner - Contributor III

I think your formula is not right:

   if (CAS_Updated_Date = (CAS_Value_Type='A'), 'CAS_Updated_Date')as Date1,

means:

if date field = true then give then return the date field.

Since the data field does not contain a true or false value it will never return the date.

You probably want to use the following expression:

if (CAS_Value_Type='A', CAS_Updated_Date)as date1

regards,

Bert

lironbaram
Partner - Master III
Partner - Master III

LOAD CAD_Activity_ID,

     CAS_Date_Value,

     CAM_ID,

     CAS_Remarks,

     CAS_Status,

     CAS_Updated_By,

     if (CAS_Value_Type='A', CAS_Updated_Date)as Date1,

     if CAS_Value_Type='T', CAS_Updated_Date)as Date2,

     if (CAS_Value_Type='A', 'A')as CAS_Value_Type1,

     if (CAS_Value_Type='T', 'T')as CAS_Value_Type2 ,

     CAS_Version

FROM

(qvd);