Discussion board where members can get started with Qlik Sense.
Hi Guy's,
I need your expert help yet again, the dates are coming out in from the SQL warehouse as "201509" which equals Sept 2015, what function and code do i use if i want the last 13 months of data.
Thanks
Solved! Go to Solution.
Try using the following
let vWhere = Date(addmonths(today(),-13),'YYYYMM');
You need to create a variable for your where-clause - try something like this:
let vWhere = if(num(month(today()))=1,
(year(today()) - 2) * 100 + 12, year(today()) - 2) * 100 + num(month(today())) - 1);
table:
SQL Select * From YourDB where Date >= $(vWhere);
- Marcus
I'm getting a error in the
let vWhere = if(num(month(today()))=1,
(year(today()) - 2) * 100 + 12, year(today()) - 2) * 100 + num(month(today())) - 1);
code in QS
Try using the following
let vWhere = Date(addmonths(today(),-13),'YYYYMM');
I think that's worked, fingers crossed. Thanks guys