# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## Six Months restriction in bar chart(May 2018 to oct 2018)

Hi Experts,

I have a date field in DD/MM/YYYY Format which contains the data from 1999 to 2022 years dates.like

Reporting Date

01/01/1999

02/02/1999

...

....

....

01/01/2022

Means in the app it contains Jan 2018 to Dec 2018 data already.

But In a bar chart I have to restrict data from current month to following 5 months bars like

May 2018,June 2018,Jul 2018,Aug 2018,Sep 2018,Oct 2018

in the next month the chart has to show data from June 2018,Jul 2018,Aug 2018,Sep 2018,Oct 2018,Nov 2018.

My Measure is Sum(sales).

1 Solution

Accepted Solutions
Contributor

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Try using MonthEnd and MonthStart

Sum({<SomeDate={">=\$(=MonthStart(Date(Today()))<=\$(=MonthEnd(Date(Today())+5))"}>}Sales)

Thanks,

Shan S

5 Replies
Valued Contributor II

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Is the 6 months always 6 months from today?  If so you, can create a flag, and then key up on that, or you can follow some of the stuff here.

how to get last 6 months data

`Sum({<SomeDate={">=\$(=MonthStart(Today(),-5)<=\$(=Date(Today()))"}>}Sales)`

Contributor II

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Hi Justin,

If we use Today() then it shows data for 6 months like

29/05/2018 to 31/10/2018

But i need to show 6 months data like

1/05/2018 to 31/10/2018

Next month it has to show data like

1/06/2018 to 30/11/2018

Contributor

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Try using MonthEnd and MonthStart

Sum({<SomeDate={">=\$(=MonthStart(Date(Today()))<=\$(=MonthEnd(Date(Today())+5))"}>}Sales)

Thanks,

Shan S

Contributor II

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Hi Shanmuga,

Sum({<SomeDate={">=\$(=MonthStart(Date(Today())))<=\$(=MonthEnd(Date(Today()),+5))"}>}Sales)

Valued Contributor II

## Re: Six Months restriction in bar chart(May 2018 to oct 2018)

Don’t forget to mark it as Correct so other people with the same problem

can find the solution.