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

Show next 4 weeks of planned data in bar chart

Hi Community.

I need to show the next 4 weeks from today of planned data in a bar chart.

This is my expression for the data in the bar chart:

Count({$<[Date Type]={'Sales_Date'},Reference_Only={'No'},[#of Days Post Sale]=-{' '},Item={'Door','Latch','Key'}>}Sales)

I believe I do not have to do anything/modify the dimensions, I only have week of as my dimension.

Any help will be greatly appreciated.

Zoe-

9 Replies
sunny_talwar

What is your expression showing currently?

ZoeM
Specialist
Specialist
Author

The expression is showing for the whole year. So I want to show only for the next 4 weeks

sunny_talwar

What is your date field called and what is it's format?

ZoeM
Specialist
Specialist
Author

I am using Week of Year. The date field format is a two digit field for week number.

ZoeM
Specialist
Specialist
Author

Hi Sunny.

I was able to get this to work but it is adding more weeks than I need (probably because I am using YearMonth in the formula):

Count({$<[Date Type]={'Sales_Dates'},Year,Reference_Only={'No'},Gateways={'Door','Latch','Key'},YearMonth={">=$(=Date(((Today())),'MMM YY'))<=$(=Date(AddMonths(Max(Today()),1),'MMM YY'))"}>}Sales)

If I try to modify it from...<=$(=Date(AddMonths(Max(Today()),1),'MMM YY'))"}>}Sales)  to


...<=$(=Date(Week((Today())+4),'MMM YY'))"}>}Sales)


I get an error.


Help...

sunny_talwar

Try this

<$(=Date(WeekStart(Today(), 5), 'MMM YY'))"}>}Sales)

sunny_talwar

But this need to be compared to a date field and not YearMonth

ZoeM
Specialist
Specialist
Author

Yea, I am using Week of Year in my Dimension and all other date fields are coming in through the date bridge hence the ...[Date Type]={'Sales_Dates'}


I used this for adding 6 months to the year (show 18 months in chart)

Count({$<[Date Type]={'Sales_Dates'},Year,Reference_Only={'No'},YearMonth={">=$(=Date(AddMonths(Max(YearMonth),-11),'MMM YY'))<=$(=Date(AddMonths(Max(YearMonth),6),'MMM YY'))"}>}Sales) and it works a charm.


I was thinking it would be easy enough to modify this for adding 4 weeks to today's date?

sunny_talwar

okay