Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

TheMdu
New Contributor II

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
gn_marvs1989
New Contributor III

Re: Case expression: with date values

2 Replies
gn_marvs1989
New Contributor III

Re: Case expression: with date values

Marcos_rv
Contributor II

Re: Case expression: with date values

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!!!