Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

gireesh1216
Contributor II

Please Find My Sample Data......I Want Script....

Hello....My Sample Data Is...

EmpidDate
121601/01/2011
121705/02/2011

1218

10/05/2012
121915/08/2012
122022/02/2016

I Want Output Like This....

EmpidHeader 2
1216Jan-2011
1217Jan-2011
1218May-2012
1219Aug-2012
1220Feb-2016
5 Replies
oknotsen
Honored Contributor III

Re: Please Find My Sample Data......I Want Script....

Use a date() function:

date(fieldname, 'MMM-YYYY')

May you live in interesting times!

Re: Please Find My Sample Data......I Want Script....

May be try this:

LOAD Empid,

          Date(Date#(Date, 'DD/MM/YYYY'), 'MMM-YYYY') as Date

FROM Source;

Sample Script:

SET DateFormat='DD/MM/YYYY';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

Table:

LOAD Empid,

     Date(Date, 'MMM-YYYY') as DateOption1,

     MonthName(Date) as DateOption2

FROM

[https://community.qlik.com/thread/206460]

(html, codepage is 1252, embedded labels, table is @1);


Capture.PNG

Employee
Employee

Re: Please Find My Sample Data......I Want Script....

LOAD

     EmpId,

     Date,

     Date(MonthStart(Date#(Date,'DD/MM/YYYY')),'MMM/YYYY') as Month

FROM yourdata;

gireesh1216
Contributor II

Re: Please Find My Sample Data......I Want Script....

Tq All

oknotsen
Honored Contributor III

Re: Please Find My Sample Data......I Want Script....

Please flag the Correct Answer and optional Helpful Answers. Thank you.

May you live in interesting times!