Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

How can I calculate a price average between two input date?

Accepted Solution Solved
Reply
Highlighted
Occasional Contributor
Posts: 9
Accepted Solution

How can I calculate a price average between two input date?

[ Edited ]

Hi everybody,

 

How can I calculate a price average between two input date? I need let the user choose a start and end date to calculate a price average between this interval. I've tried to use a dropdown list, but the dropdown list filtered all my chart (the same to the slider) and I need just define a date interval to calculate and put the result in a simple text input (or any other out type to user visualization), without change my chart or data table. Thanks!


Accepted Solutions
Solution
a week ago
Occasional Contributor
Posts: 12

Re: How can I calculate a price average between two input date?

Hi Thiago,

 

I would suggest you to use the Slider object to enter the date.

To avoid the date filter to change the information in all objects in your report, you can use the Slider inside a Container in your Report and instead of using the Filters in the Section Prompt.

This way you will have to create interactions within your Slider (Date Filter) and the objects that you want to filter, than you would have filtered only the objects you want an not all the report.

Once you have the date defined you can select your 'PriceInformation' table in your data source and change the aggregation to Avegare.

Maybe you want to duplicate your 'PriceInformation' data so you would have both, the Sum and Average, here are some screenshots.

 

I hope it helps!

 

1.jpg2.jpg3.jpg 

 

View solution in original post


All Replies
Trusted Advisor
Posts: 1,784

Re: How can I calculate a price average between two input date?

[ Edited ]

 

How can I calculate a price average between two input date?

 

But what exactly is the problem? You make it sound as if computing an average is the problem, that's your first sentence and title. Surely that can't be the actual problem. Is the real problem how to let the user define the interval?

Occasional Contributor
Posts: 9

Re: How can I calculate a price average between two input date?

 

 

I thought about using two text input to allow the user to enter dates, using two parameters to convert text to date, but I do not know how can I use those two dates to calculate an average between the interval.

 

"Is the real problem how to let the user define the interval?"

 

If you have a better suggestion to let the user define the interval, I would be grateful to know. As I sad, I've tried to use two dropdown list, but the dropdown list filtered all my chart =\

 

Thanks and sorry for my English. 

Solution
a week ago
Occasional Contributor
Posts: 12

Re: How can I calculate a price average between two input date?

Hi Thiago,

 

I would suggest you to use the Slider object to enter the date.

To avoid the date filter to change the information in all objects in your report, you can use the Slider inside a Container in your Report and instead of using the Filters in the Section Prompt.

This way you will have to create interactions within your Slider (Date Filter) and the objects that you want to filter, than you would have filtered only the objects you want an not all the report.

Once you have the date defined you can select your 'PriceInformation' table in your data source and change the aggregation to Avegare.

Maybe you want to duplicate your 'PriceInformation' data so you would have both, the Sum and Average, here are some screenshots.

 

I hope it helps!

 

1.jpg2.jpg3.jpg 

 

Occasional Contributor
Posts: 9

Re: How can I calculate a price average between two input date?

Hi gcarvalho, thank you for the help!

 

I'll try your tip and come back here to tell you if it worked!

 

Thanks!

Occasional Contributor
Posts: 9

Re: How can I calculate a price average between two input date?

Thank you gcarvalho, your solution worked perfectly for me!

 

You can see the result in the attached image, thank you.

 

print.jpg

Occasional Contributor
Posts: 12

Re: How can I calculate a price average between two input date?

Hi Thiago, 

 

 

I'm glad to see that it works for you.

Looks like you are doing some reports in Portuguese, good to see SAS users from Brazil or Portugal maybe.

Thanks and best regards! 

Occasional Contributor
Posts: 9

Re: How can I calculate a price average between two input date?

Yes gcarvalho, you are right, I'm from Brazil! best regards to you too, thank you again!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 244 views
  • 4 likes
  • 3 in conversation