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: 
TheMdu
Contributor III
Contributor III

Case expression: with date values

Hello,

How do I use apply this case expression when loading a .qvd?

Code works perfectly if my data source is SQL.

Looked at various examples posted on this forum, but could'nt find anything that deals with a date range?

"Select *,

case

when ImportDate between '2017-12-01 00:00:01' and '2017-12-31 23:59:00' then '2017/12'
when ImportDate between '2018-01-01 00:00:01' and '2018-01-31 23:59:00' then '2018/01'
when ImportDate between '2018-02-01 00:00:01' and '2018-02-28 23:59:00' then '2018/02'
when ImportDate between ' 2018-03-01 00:00:01' and '2018-03-31 23:59:00' then '2018/03''
end as ConversionMonth

from tblsales"

 

Thanks

1 Solution

Accepted Solutions
2 Replies
gn_marvs1989
Contributor III
Contributor III

Marcos_rv
Creator II
Creator II

Hi how are you??
mmmmm it does not serve you directly to use the date to remove the year / month ??
try this:
(Preceding Load)
load *,
year (ImportDate) & '/' & num (month (ImportDate), '00') as ConversionMonth;

sql select *
from resident tblsales;

 


Regards!!!