Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

How to select certain data from a dimension and create them as a new dimension? Thanks

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!

Tags (1)
8 Replies

Re: How to select certain data from a dimension and create them as a new dimension? 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...

;


talk is cheap, supply exceeds demand
MVP
MVP

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

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.

djallelsadki
Contributor

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

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

Not applicable

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

Thanks for that Gysbert, appreciate the help.

Not applicable

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

Thanks for that jagan, that was really helpful. Cheers.

Not applicable

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

Hey Djallel, that really helps! Thanks for that.

mov
Esteemed Contributor III

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

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"

Not applicable

Re: How to select certain data from a dimension and create them as a new dimension? Thanks

Yup, spot on. Thanks Michael!

Community Browser