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: 
CK_WAKE
Creator
Creator

CASE Statement while loading the data from the qvd

Hi There,

I want to apply similar SQL case statement as below in the QVD while loading the data. Please guide me. Thanks.

CASE
WHEN RAISED_DATE < TO_DATE('30-06-2016', 'DD-MM-YYYY') THEN TO_DATE('01-07-2016', 'DD-MM-YYYY')
ELSE RAISED_DATE

END AS RAISED_DATE_MIN

Labels (5)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this if you want as field name

if( raised_date < date('30-06-2016' ), date( 01-07-2016),  raised_date)  as RAISED_DATE_MIN

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

4 Replies
Anil_Babu_Samineni

Perhaps this?

Load * From <<Table>> 
Where RAISED_DATE > Date('30-06-2016', 'DD-MM-YYYY') and RAISED_DATE <=Date('01-07-2016', 'DD-MM-YYYY');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
CK_WAKE
Creator
Creator
Author

Hi Anil, Thanks for getting back.
I dont want to apply a data filter,  what i want to achieve is

if raised_date < less than '30-06-2016' , then input the date as 01-07-2016 otherwise keep the date of raised_date, and I am creating a new column as RAISED_DATE_MIN for this condition.  Let me know if i am not clear about this.

RAISED_DATE < TO_DATE('30-06-2016', 'DD-MM-YYYY') THEN TO_DATE('01-07-2016', 'DD-MM-YYYY')
ELSE RAISED_DATE

Anil_Babu_Samineni

Try this if you want as field name

if( raised_date < date('30-06-2016' ), date( 01-07-2016),  raised_date)  as RAISED_DATE_MIN

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
CK_WAKE
Creator
Creator
Author

Thanks Anil, it worked. Cheers