Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm very new to Qlik SENSE and would really appreciate the help that I can get, thanks.
Basically, I have a field known as 'DELIVERY_DATE' which consists of Jul 2013, Aug 2013, Sep 2013 ....... up to Mar 2015, Apr 2015 and May 2015.
I would like to create a new field out of it to use it as a dimension, let's call it 'DELIVERY_DATE 2014-2015', which will only consist of July 2014, Aug 2014 up to May 2015.
For your info, I did try to use the wildmatch and pick syntax within my if statement and I almost got it except the fact that the false expression is also present within my new dimension which I don't desire.
Can someone please shed some light upon it, thanks!
Perhaps like this:
LOAD *, If(DELIVERY_DATE >= makedate(2014,7) and DELIVERY_DATE < makedate(2015,6), DELIVERY_DATE]) as [DELIVERY_DATE 2014-2015]
LOAD
date(date#(DELIVERY_DATE,'MMM YYYY'),'MMM YYYY') as DELIVERY_DATE ,
...other fields...
FROM ...source...
;
Hi,
Try like this
LOAD *,
If(DELIVERY_DATE >= Makedate(2014,7) and DELIVERY_DATE <= Makedate(2015, 6, 30), DELIVERY_DATE]) as [DELIVERY_DATE_2014-2015]
FROM DataSource;
Regards,
Jagan.
Hello,
Try this :
LOAD *,
If(right(DELIVERY_DATE,4)=2014 OR right(DELIVERY_DATE,4)=2015,DELIVERY_DATE) as [DELIVERY_DATE_2014-2015]
FROM Datasource;
Best regards,
D.Sadki
Thanks for that Gysbert, appreciate the help.
Thanks for that jagan, that was really helpful. Cheers.
Hey Djallel, that really helps! Thanks for that.
I assume that you need last 11 months rather than from fixed "July 2014" to fixed "May 2015", that is you don't want to change script every month.
If my guess is correct, you can use this:
if(DELIVERY_DATE >= monthstart(today(),-10) AND DELIVERY_DATE <= monthend(today()), DELIVERY_DATE) as "Delivery Date Last 10 Months"
Yup, spot on. Thanks Michael!