Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

May2018-Oct 2018 restriction in bar chart

Hi Experts,

Can any one please help me on below requirement.

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).


Please help me to include this 6months restriction expression in the above measure.


Thanks in advance.

3 Replies
vishsaggi
Champion III
Champion III

Can you provide some sample data or qvw file to look into?

shiveshsingh
Master
Master

Can you try this?

=sum({<Date = {">=$(=Date(Max(Date),'DD/MM/YYYY'))<=$(=(Addmonths(Date),-5))"}>}Sales)

Anil_Babu_Samineni

May be this as measure?

Sum({<[Reporting Date]={">=$(=Date(MonthStart(AddMonths(Max([Reporting Date]),-5)),'DD/MM/YYYY'))<=$(=Date(MonthEnd(Max([Reporting Date]),'DD/MM/YYYY')))"}>} sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful