BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
harshpatel
Quartz | Level 8

Hello Folks,

I have a drop down list month

Mar

I have a list table in my report area which have 2 columns month and salary

Suppose from drop down list i am selecting Mar then the value should come from jan to mar and rest of the month should get 0 values as seen below.

I want the output as below in SAS VA

Month         Salary

Jan               10000

Feb                20000

Mar                30000

Apr                   0

May                 0

 

Regards,

Harsh Patel

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PetriRoine
Pyrite | Level 9

Hello @harshpatel,

 

Here's how you can do that.

 

Step 1: Create a parameter

  1. In the Data pane, click New data item, and then select Parameter. The New Parameter window is displayed.
  2. Modify the Name of the parameter f.ex. _par_month
  3. Select the Type = Date for the parameter.
  4. Specify additional information: Minimum value, Maximum value and Current value. Do not get confused about the Year as it doesn't matter. Select a preferred Format = Month.
  5. Click OK and your new parameter can be found from the bottom of Data pane.

Step 2: Apply parameter role to Drop-down list

  1. Select your Drop-Down list and open the Data Roles pane.
  2. Assign you just created parameter _par_month to the role Parameter.

Step 3: Create a new calculated item

  1. In the Data pane, click New data item, and then select Calculated item. The New Calculated Item window is displayed.
  2. Enter a Name f.ex. My Salary
  3. Create formula shown below:
    Comm_Capture.PNG
    IF ( '_par_month'p >= 'Month'n )
    RETURN 'Salary'n
    ELSE 0

Now you can utilize your new measure in the report.

Comm_Capture2.PNG

 

I hope this helps!

 

Best regards,
Petri

View solution in original post

2 REPLIES 2
PetriRoine
Pyrite | Level 9

Hello @harshpatel,

 

Here's how you can do that.

 

Step 1: Create a parameter

  1. In the Data pane, click New data item, and then select Parameter. The New Parameter window is displayed.
  2. Modify the Name of the parameter f.ex. _par_month
  3. Select the Type = Date for the parameter.
  4. Specify additional information: Minimum value, Maximum value and Current value. Do not get confused about the Year as it doesn't matter. Select a preferred Format = Month.
  5. Click OK and your new parameter can be found from the bottom of Data pane.

Step 2: Apply parameter role to Drop-down list

  1. Select your Drop-Down list and open the Data Roles pane.
  2. Assign you just created parameter _par_month to the role Parameter.

Step 3: Create a new calculated item

  1. In the Data pane, click New data item, and then select Calculated item. The New Calculated Item window is displayed.
  2. Enter a Name f.ex. My Salary
  3. Create formula shown below:
    Comm_Capture.PNG
    IF ( '_par_month'p >= 'Month'n )
    RETURN 'Salary'n
    ELSE 0

Now you can utilize your new measure in the report.

Comm_Capture2.PNG

 

I hope this helps!

 

Best regards,
Petri

harshpatel
Quartz | Level 8
Thanks petriroine it helps me lot

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1251 views
  • 1 like
  • 2 in conversation