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

I want to display the last 6 months sales in a chart from todays date

I want to display the last 6 months sales (not accumulated) figures from todays date.  Do i do this in the expression, script or by using variables.

Regards

8 Replies
Anonymous
Not applicable
Author

O yeah, i can't use Dimension limit because i have some figures in future months, that's why i need the previous 6 or 12 months from today rather than the last date in the MonthEnd field.

Thanks

PrashantSangle

Hi,

You can do this by using expression.

Like

Sum({<dateField={"<$(=Today())>=$(=Addmonths(Today(),-6))"}>}Sales)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
its_anandrjs

In expression write like

Sum({<Month ={'>$(=num(Month( AddMonths( Today(),-6))))<=$(=num(Month(Today())))'}>} Sales)

Anonymous
Not applicable
Author

What shall i use for the Dimension? i've tried using Month and i get "No data to display in the chart"

PrashantSangle

Hi,

Use Customer Number, any KPI which you want show against Month sales

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
MK_QSL
MVP
MVP

Dimension

Your KPI (i.e. [Customer Name] or Country or Brand or Supplier etc.)

There are two different approaches shown below.

1) Based on Date Field

=SUM({<[Your Date Field] = {">=$(=AddMonths(MonthStart(Today()),-5))"}>}Sales)

Note : [Your Date Field] should be having same format as per your script Date Format

SET DateFormat = '';

2) Based on YearMonth

if you create YearMonth Field in your script as below

Date (monthstart ([Your Date Field]) , 'YYYYMM')as YearMonth,

You can use below expression

=SUM({<YearMonth = {">=$(=Date(AddMonths(MonthStart(Today()),-5),'YYYYMM'))"}>}Sales)

Hope this helps....!!!

MK_QSL
MVP
MVP

Have you tried the solution provide by me?

Anonymous
Not applicable
Author

I'll get back to this soon and let you know how i get on.