BookmarkSubscribeRSS Feed
wrosario
Calcite | Level 5

I am needing to create an advanced filter while the information map, the filter would be a prompt for an initial period least 365 days, you have any suggestions?

5 REPLIES 5
Madelyn_SAS
SAS Super FREQ

Can you provide more detail about your goal?

wrosario
Calcite | Level 5

I am creating a filter within the information map that you can bring me the last 12 months of a certain amount, but to know the last 12 months the user will have to enter a month, then the only way I'll figure out who are the last 12 months.

Prompt: Fev - 2014

Result Report

Month    Profit

Fev-14     15
Jan-14     10
Dez-13     28
Nov-13     30
Out-13     15
Set-13     30
Ago-13     20
Jul-13     20
Jun-13     20
May-13     20
Apr-13     20
Mar-13     20

Tks for all

RainB
Calcite | Level 5

Hi,

The solution little bit depends how the date data item is used in your information map.

What I tried and maybe helps you is this(I used dummy data for testing).

data library.test_data;

input mon date9. value;

datalines;

01Feb2014     15

01Jan2014     10

01Dec2013    28

01Nov2013     30

01Oct2013     15

01Sep2013     30

01Aug2013     20

01Jul2013     20

01Jun2013     20

01May2013    20

01Apr2013     20

01Mar2013     20

;

Then in the information map studio I defined mon data item as "Date" type and used format EURDFMY and called it DataItem1.

Next I created filter that looks like this:

filter.jpg

And when I test this filter, I get this selection:

filter2.jpg

and results are here:

filter3.jpg

Kind Regards,

Rain

wrosario
Calcite | Level 5

Rain,

The problem is that the second date (to) not being in accordance with the first choice, it is always based on the current date minus the number of months in crate side.

Example:

From Date: Dez 14

To Date: N Months ago (Feb 14, Jan 14, Dez 14, Nov 14, Oct 14 , Sep 14 )

right would

From Date: Dez 14

To Date: N Months ago (Dez 14, Nov 14, Oct 14 , Sep 14, Ago 14 )

Tks

RainB
Calcite | Level 5

wrosario wrote:

Rain,

The problem is that the second date (to) not being in accordance with the first choice, it is always based on the current date minus the number of months in crate side.

Example:

From Date: Dez 14

To Date: N Months ago (Feb 14, Jan 14, Dez 14, Nov 14, Oct 14 , Sep 14 )

right would

From Date: Dez 14

To Date: N Months ago (Dez 14, Nov 14, Oct 14 , Sep 14, Ago 14 )

Tks

Hi again,

Your requirement is something that I am not sure can be achieved- dynamic calculation. Or maybe someone else with more knowledge can help you out.

Rain

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 830 views
  • 0 likes
  • 3 in conversation