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

Omit current week from rolling average via expression/chart property?

I've been requested to omit the current week from a rolling average chart.

calculated dimension expression currently used:     =date(WeekStart(dev_finish_date),'MMM-D')

I was able to display only the last 13 weeks via the chart property "Max Visible Number", but is there any way to NOT display the current week?

-----ALSO-----

They want the weeks to start on Sundays as opposed to Mondays. I've found things regarding this on the site, but don't know how to relate the unassociated chunks of code they suggest to mesh with all the date fields I've linked to in the database.

1 Reply
Not applicable
Author

I found out I didn't need some extraneous Master Calendar script!!! Here's what I did.

  1. Performed a search in a search box object with this criteria:      =your_date_field<Today()-6
  2. Scrolled down to "your_date_field" in the search results, expanded the listings with the "+" button, and clicked on "your_date_field" to select all the records that satisfied the search condition.
  3. Selected any other criteria I wanted to include and created a bookmark (BM21).
  4. Entered this dimension into my rolling average chart:         =date(WeekStart(your_date_field),'MMM-D')
  5. Entered this expression into my rolling average chart:        =avg({BM21}my desired calculated expression)
  6. On the presentation tab of the chart, changed "Max Visible Number" to 13 and checked "Reversed"

 

Voila, it doesn't show any incomplete weeks. Just remember the main things that assisted were the search box and the bookmark. I'm sorry if it doesn't explain too much, but it's a whole lot easier than a Master Calendar script AND there's no variables to create and store.