Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

leacueva
New Contributor II

Grouping Dates by Month

What is the expression to group dates by month?

I have a data set with dates that I uploaded via a spreadsheet.  I created a bar chart with Qlik, but I need the individual dates to be grouped by month.  

For example, I need 12/01/2017 through 12/31/2017 showing as Dec 2017, 01/01/2018 through 01/31/2018 showing as Jan 2018, and so on.

I'm an expression newbie so please explain in very simple terms.

Thank you so much!

3 Replies
marmentrout5
Contributor

Re: Grouping Dates by Month

In your load script you could add another column:

DATE(<your date field>,'MMM-YYYY')    AS MMMYYYY

Then use that field as your dimension.  HTH

sasiparupudi1
Honored Contributor III

Re: Grouping Dates by Month

You generally use a master calendar linked yo your fact on keydate.

Else

Use date# and date functions

Ex

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

Hth

yujiyamane
Contributor II

Re: Grouping Dates by Month

Hi Lea,

There are few ways to do what you want.

The quick win is to add below dimension into your chart.

=Date([xxx Your Date Field Name xxx],'MMMMYYYY')


The best way is to add master calendar dimension in your data model.

https://community.qlik.com/thread/48693


Hopefully this helps you. Good luck!

Community Browser