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

Trend last 8 weeks in Pivot Table

Hey Everybody,

I need to show the Sales Trend for the last 8 Weeks. The results should be expressed as a percentage.

In a line Chart it's able to click on "linear trend" but how can I fix it in a straigt/pivot table?

My first try looks like this:

LINEST_M(
aggr(sum(Sales),Articlegroup,Date),aggr(rank(Date),Artcelgroup,Date))

(this is for all data)

The result is weired: The Line chat shows a falling trendline and the slope of the Linest_M function is positive. So my calculation is going wrong.

Has anybody a Idea how to fix my problems?

1) How to implement the "last 8 weeks" contition?

2) Whats going wrong with my Line_m calculation?

 

Thanks!

 

 

 

3 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try:

LINEST_M(
aggr(sum(Sales),Articlegroup,Date),Date)

EMCK
Contributor
Contributor
Author

Thanks.

that work's for the general trend over all Data. 

But is it possible to calculate the trend for the last 8 weeks?

Brett_Bleess
Former Employee
Former Employee

Evelin, do not forget to give Arthur credit for fixing the main expression, you can use the Accept as Solution button that post to cover that part of things.  I believe the 8 week solution has to be via Set Analysis, but unfortunately I am not a guru with that, so the best I can do is point you to some useful links but my post will kick things back up, so someone else may be able to provide the actual syntax for you too.

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

I think you may want the Dates in Set Analysis link at the bottom of the above link actually, but I figured better to give you the main post with the other links in it...  Sorry I am not more help to you.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.