9 Replies Latest reply on Nov 5, 2018 5:18 PM by lei.chen.0

How to get dynamic average value as title base on date range filter?

Hi

I have data like this:

标题 1标题 2标题 3
DATEPRODUCTVALUE
20180101A1
20180102A2
20180103A3

If I set date range from 20180102 - 20180103, I want to show the average value(2+3)/2 = 2.5 in the title and bar plot [2, 3]. How to do this?

Thanks!

• 1. Re: How to get dynamic average value as title base on date range filter?

Hello Yun,

Please try LOD and context filter like this.

The calculation used in the screenshot is,

'Date From ' + STR({MIN([DATE])}) + ' To ' + STR({MAX([DATE])}) + ' with AVG - ' + STR({AVG([VALUE])})

Regards

Lei

• 2. Re: How to get dynamic average value as title base on date range filter?

Hi, Lei

Thank you! But when I change the date range, the average value doesn't change, do I miss something? By the way, I have another filter for product, does it matter? Thanks!

• 3. Re: How to get dynamic average value as title base on date range filter?

Hello Yun,

Since [DATE] is added to context, LOD calculations change when DATE filter changes.

Here are the screenshots.

If possible, please attach a sample workbook, so that I could check what is missing.

Regards

Lei

• 4. Re: How to get dynamic average value as title base on date range filter?

Hi, Lei

Here is my sample data. Thank you for your help.

• 5. Re: How to get dynamic average value as title base on date range filter?

Hello Yun,

What is missing is "Add to Context".

Just check it for both [DATE] and [PRODUCT].

Regards

Lei

1 of 1 people found this helpful
• 6. Re: How to get dynamic average value as title base on date range filter?

Thank you so much, help me a lot!!!!

• 7. Re: How to get dynamic average value as title base on date range filter?

Hello Yun,

My pleasure

Regards

Lei

• 8. Re: How to get dynamic average value as title base on date range filter?

Hi, Lei

May I ask another question? I notice the {} in the LOD expression, and I search it online, it means:

 Element Description { } The entire level of detail expression is enclosed in curly braces.

But I am confused, does it equal to FIXED on filter? Like FIXED PRODUCT in this example?

Thanks!

• 9. Re: How to get dynamic average value as title base on date range filter?

Hello Yun,

{ ... } works the same as { FIXED : ... } when the field after FIXED is omitted.

Regards

Lei