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

Two categories name in 1 Dropdownlist and display values on Slider

Accepted Solution Solved
Reply
Contributor SKG
Contributor
Posts: 55
Accepted Solution

Two categories name in 1 Dropdownlist and display values on Slider

Hi Guys,

 

Actually i'm facing a problem on SAS VA level.

I've two Categories

1) Shipping Date

2) Order Date

I want these two Categories name in one dropdownlist but when i'm going to select "Shipping Date" from dropdownlist then i want the values of shipping date in "Slider object" as same for "Order Date" too.

 

I attached a snapshot. Please check it and let me know, is there any solution for that?

 

Regards,

Sunny Kumar Gupta


Untitled.png

Accepted Solutions
Solution
‎09-23-2016 02:29 PM
SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

I understand what you are trying to accomplish and what I've been trying to tell you should solve the problem. Let's break it down into to phases:

1. Get the dropdwon with two vaues

2. Get the slider populated with the date referent to the option selected from the dropdown

 

For #1:

You have two options:

1. get a small table (one column, two rows) loaded in memory. The two rows will contain the two character values you want in the dropdown.

2. derive a custom category from existing category. For example, if you have a category in your table with 10 different values, you woud group 5 of them and call "Shipping Date" and the remaining 5 you woud group under "Order Date". That's what I'm calling the random assignment.

 

The output of #1 is a column that I'm calling DateType. You should assign DateType as the Category in the Roles tab.

 

For #2:

1. create and assign a character parameter in the Parameter role of your dropdown.

2. create a date calculated item (I'll call it simply Date) that looks like this (I'm using the names you've provided):

if 'parameter'p = "Shipping Date"

return 'Ship Date'n

else 'Full Date_'n

3. assign calculated column Date to the slider

 

You now should be able to select "Shiping Date" or "Order Date" from the dropdown and depending on your selection you should see the slider beeing populated with the corresponding date.

 

Cheers,

Renato

 

View solution in original post


All Replies
SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

Hi @SKG,

 

The first thing you need to do is have a column (category) with values Shipping Date and Order Date to populate the dropdown. You can either create a tiny table with one column and two rows for that, and add that table to your report, or you can create a calculated item based on a random number between 0 and 1 that returns "Shipping Date" if number < 0.5 or "Order Date" otherwise. As you can imagine, this method is only statiscally safe if the number of rows you have in your table is not too small.

 

The next step is to assing a character parameter to the dropdown and use that parameter to derive a calculated column (e.g. Date) that returns the value of Shipping Date or Order Date, depending on the parameter value, something like this:

if 'parameter'p = "Shipping Date"

return 'Shipping Date'n

else 'Order Date'n

 

Now you can use the new Date column to populate the slider.

 

Best,

Renato

Contributor SKG
Contributor
Posts: 55

Re: Two categories name in 1 Dropdownlist and display values on Slider

Hi Renato,

 

Can you please elaborate the last method? because 1st and 2nd methods, i didn't get it anything.

And i tried to do it same earlier but i'm getting only one value. look at once

 

 

Actually i want to create a category with two values... nothing more

 

Untitled1.png

 

Please resolve my issue....

 

Regards,

Sunny Kumar Gupta 

SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

What calculated column did you use to populate the dropdown? Could you please send me its expression?

 

Thanks,

Renato

Contributor SKG
Contributor
Posts: 55

Re: Two categories name in 1 Dropdownlist and display values on Slider

My question is so simple, i want to display two own values in a dropdown list.

 

Category name: Select Date Type

1st Value name: Shipping Date

2nd value name: Order Date

 

Untitled.png

SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

Hi SKG,

 

The first thing you need to do is have a column (category) with values Shipping Date and Order Date to populate the dropdown. I don't think you have that column (do you?). Assuming you don't have that column, I've given you two ways that you can get that column, and based on your previous inquiry, it seemed to me that you were trying to use the second method when you said "Can you please elaborate the last method?". The second method requires a calculated column that uses a random number. I thought there was a function for that in VA, but it seems that I was wrong. I apologize for that.

 

So let me start over... Are there other category columns in your data? If you have, you can create a custom category that randomly maps a few values to "Shipping Date", and the rest of the values to "Order Date". This little trick will give you a new column with the values that you need for the dropdown. It doesn't make sense to use this dropdown with interaction neither as a section or report filter, and that's why I've explained you to use parameter, which you seem to be done already.

 

If this is still confusing, please send a sample of your data.

 

Thanks,

Renato

Contributor SKG
Contributor
Posts: 55

Re: Two categories name in 1 Dropdownlist and display values on Slider

Hi Renato,

 

Thank for helping,

 

Apology for poorly explained.

 

Actaully i've two Categories Shipping Date and Order Date

 

date typpe.png

Full Date_ is Order Date

Ship Date is Shipping Date

 

I want to display the name of categories ("Order Date", "Shipping Date") in a dropdown list like this

 

selected date type.png

 And values of them i want to display in Slider. I'll do this one to display the values of "Order Date" and "Shipping Date" in Slider except display the name of categories ("Order Date", "Shipping Date") in a dropdown.

 

---------------------------------------------------------------------------------------

what i did, i'm explaining you very well

---------------------------------------------------------------------------------------

1)  I created two prameters with the Current values of "Order Date" and "Shipping Date"

parameters.png

 

2) Then I created calculated item.

 

Calculated parameters.png

 

3) But i'm getting only one name "Shipping Date" Smiley Sad

 

seleted date type.png

 

I hope so this time i explained you very well. Please try to reslove this solution

 

Regards,

Sunny Kumar Gupta

Solution
‎09-23-2016 02:29 PM
SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

I understand what you are trying to accomplish and what I've been trying to tell you should solve the problem. Let's break it down into to phases:

1. Get the dropdwon with two vaues

2. Get the slider populated with the date referent to the option selected from the dropdown

 

For #1:

You have two options:

1. get a small table (one column, two rows) loaded in memory. The two rows will contain the two character values you want in the dropdown.

2. derive a custom category from existing category. For example, if you have a category in your table with 10 different values, you woud group 5 of them and call "Shipping Date" and the remaining 5 you woud group under "Order Date". That's what I'm calling the random assignment.

 

The output of #1 is a column that I'm calling DateType. You should assign DateType as the Category in the Roles tab.

 

For #2:

1. create and assign a character parameter in the Parameter role of your dropdown.

2. create a date calculated item (I'll call it simply Date) that looks like this (I'm using the names you've provided):

if 'parameter'p = "Shipping Date"

return 'Ship Date'n

else 'Full Date_'n

3. assign calculated column Date to the slider

 

You now should be able to select "Shiping Date" or "Order Date" from the dropdown and depending on your selection you should see the slider beeing populated with the corresponding date.

 

Cheers,

Renato

 

Contributor SKG
Contributor
Posts: 55

Re: Two categories name in 1 Dropdownlist and display values on Slider

Hi Renato,

 Thanks it's working now

 

But For #1 - Option 2nd is not working in section prompt. It's working fine only in Objects Area.

 

But it's great...

 

thanks

thanks lot Renato..

SAS Super FREQ
Posts: 71

Re: Two categories name in 1 Dropdownlist and display values on Slider

I'm glad to hear it worked.

 

Controls added to section or report automatically filter the report objects and this is not what we want. This is why we can only add the

dropdown to the report body and use parameter instead of interaction.

 

Best,

Renato

☑ This topic is SOLVED.

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

Discussion stats
  • 9 replies
  • 555 views
  • 0 likes
  • 2 in conversation