Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hiya
i need to load data with filter from SQL into qlik sense
i need to load data from a specific date range only
e.g from 2005 to present
i have found on forum how to do this for txt file (but i need to do this for SQL) ... but only for between to dates. but i need 2005 to present
Loading data with filter on date
please help
Kind Regards
Joeybird
try
let vstart='20150101';
let vend=date(Today(), 'YYYYMMD');
LOAD *;
SQL SELECT *
FROM somesqlservertable
where dat_data >= '$(vstart)' and dat_data <= '$(vend)'
;
try
let vstart='20150101';
let vend=date(Today(), 'YYYYMMD');
LOAD *;
SQL SELECT *
FROM somesqlservertable
where dat_data >= '$(vstart)' and dat_data <= '$(vend)'
;
Hi,
Here's some examples :
Oracle : WHERE MyDate BETWEEN TO_DATE('01/01/2005','mm/dd/yyyy') AND SYSDATE
Sql Server 2012 : WHERE MyDate >= CAST('01/01/2005' AS DATE) AND MyDate <= GETDATE()
Xavier.
Hiya
this worked fab, but would like to as well only 2005 load e.g certain departments data criteria too from SQL?
I have this to get my drop down
if(Wildmatch([DepartmentCode], '*999'), [Department]) as [Department],
how would I use this to only load in certain department data too?
Kind Regards
Joeybird
Hiya
I meant to say
if(Wildmatch([DepartmentCode], '*999'), [Department]) as [DepartmentDropDown],
please help
Kind Regards
Joeybird
filter in Qlik
LOAD *
where wildmatch([DepartmentCode], '*999')
;
SQL SELECT *
FROM somesqlservertable
where dat_data >= '$(vstart)' and dat_data <= '$(vend)'
;
filter in Sql
LOAD *
;
SQL SELECT *
FROM somesqlservertable
where dat_data >= '$(vstart)' and dat_data <= '$(vend)'
and departmentcode like '%999'
;
Hiya
A *** brill xx
thank you
Kind Regards
Joeybird