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

current week's worth

Reply
Regular Contributor
Posts: 163

current week's worth

[ Edited ]

It seems an easy task but I can't fugure it out; I want to filter a report from Now() to Now()-7 ; basically the current week's worth of data.

Assuming data in memory with a date and date time available to use.

Can anyone help me on this?

Contributor
Posts: 69

Re: current week's worth

you can use filter tab on the right hand side of your report desinger to filter the data you want to see in the report.

Regular Contributor
Posts: 163

Re: current week's worth

but would that be relative to a week or hard coding some dates?
Contributor
Posts: 69

Re: current week's worth

I guess, it would be hardcoding for some dates.
Contributor
Posts: 69

Re: current week's worth

or else you can add a slider as filter on your report and assign date category to it.
Regular Contributor
Posts: 163

Re: current week's worth

thanks; I was looking foor som preiodic type function; so when the report is refreshed , it only refreshes for the current week; assuming I only have a date and date time available in memory - i.e not having to go back to ETL.

Contributor
Posts: 69

Re: current week's worth

There is option of function of relative period when you calculate aggregated column, if you want to aggregate something for a relative period, please check if its useful for you.
SAS Super FREQ
Posts: 286

Re: current week's worth


Explore_SAS wrote:
There is option of function of relative period when you calculate aggregated column, if you want to aggregate something for a relative period, please check if its useful for you.

 

RelativePeriod operator does not work at the week level, unfortunately.

Contributor
Posts: 69

Re: current week's worth

Hey sam do you know, how the option of _Inferred_ for grouping period it says that it takes the grouping based on data in the report but it never worked for me.
SAS Super FREQ
Posts: 286

Re: current week's worth


Explore_SAS wrote:
Hey sam do you know, how the option of _Inferred_ for grouping period it says that it takes the grouping based on data in the report but it never worked for me.

 

An issue with _Inferred_ is that it will often use an inferred interval period of "day" for the inner interval but the LASR function does not like to process "day" and so the operator returns missing values in most cases.

 

If your date data item has a format like MMMYYYY, then _Inferred_ should correctly set the inner interval to "Month".

 

Personally I always set the interval parameters to the period I want rather than using _Inferred_.

 

Eventually this should work better than it does right now.

Contributor
Posts: 69

Re: current week's worth

The problem with us is that, we have to calculate the difference with between relative date like what is change of value from yesterday to today. by default VA doesn't have option to choose interval as day. so we have to rely on _inferred_ assuming that VA with automatically understood looking at the data.
SAS Super FREQ
Posts: 286

Re: current week's worth

[ Edited ]

The periodic operators do not handle relative dates correctly when the interval is day. Possibly some day processing was supported in earlier releases but it could return bad results. The operators were changed to always return missing values when the interval is day and there is any offset processing to do. I don't remember whether day processing was enabled in any customer-facing release.

Day interval is still fine for operators like Period that do not calculate a difference between dates.

Regular Contributor
Posts: 173

Re: current week's worth

Answer to your first question is this code used in the filter.

It wil filter out your data for the last 7 days.

If you need the running week then you need a sligtly different code.

Greetings  Peter

06-02-2016 16-19-25.png

Ask a Question
Discussion stats
  • 12 replies
  • 534 views
  • 0 likes
  • 4 in conversation