3 Replies Latest reply on Jan 6, 2018 4:36 AM by Jim Dehner

calculate 2 weeks average dynamically

Hi,

I have a requirement where I extract data for 6 weeks 48 days  every day.

I need to  show bar graph with 3 bars where each bar should show 2 weeks avg.

For example I have Week 22,23,24,25,26,27

22 and 23 weeks avg  in one bar

24 and 25 weeks avg in second bar

26 and 27 weeks avg  in third bar

I created the below calculated field  and plotted the graph with week and I am  getting 6 bars instead of 3.

I am not sure how to fix this issue.Is there any other way to achieve this ?

2 weeks avg = Window_Avg(Sum([CRD %]),-1,0)

also i need the week numbers to be displayed in tool tip dynamically .currently each bar is showing only one week number

• 1. Re: calculate 2 weeks average dynamically

Hi

see attached

it returns this

as shown

the formula includes a function Mudolo (that is what the % indicates) as written it will return a 0 on the even number points and a 1 on the odds - so it treats the data in pairs like you wnat

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• 2. Re: calculate 2 weeks average dynamically

Hi Jim,

Iam getting only 3 bars now which is exactly what is want

but the tool tip is showing only one week and also the percentage of CRD is missing in tooltip

How do I fix this?

• 3. Re: calculate 2 weeks average dynamically

Hi

see the attached

first the week band label

Then a filter to eliminate the gaps in the chart

Now the tooltip

Change it by selecting the Insert button and selecting the fields you want

Now the viz

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful