BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sam2022
Obsidian | Level 7

Hi,

 

I want to show blank values for tables or graphs if the text input is blank.

Untitled.png

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

I get the same error you do when I try this on 7.5.

 

I think I have a workaround that might help.

 

1. Edit your parameter and set the current value to be something crazy like 01JAN1900.

2. Ensure the text input has a filter link to the list table on the Actions pane.

3. Make an advanced filter on the list table. Set the expression to select where the parameter value is NOT the current value from step 1 AND not missing. For me, this expression looked like: ( 'Parameter 1'p NotIn ('1JAN1900'd) ) AND ( 'Parameter 1'p NotMissing )

4. Do not include a calculated item based on the parameter in your list table. This will cause the "an error occurred" when the parameter value is not set.

 

In the screenshot below, the table is filtered when you enter a text value.

 

 

missing4.png

When no value is specified, the table is empty and the warning icon says "The filter resulted in an empty set of data". 

 

missing3.png

That is probably the closest we can get to what you want in 7.5.

 

Sam

View solution in original post

15 REPLIES 15
JosvanderVelden
SAS Super FREQ
I assume the date field is a filter. Can you use a default date that is outside of your date range?
Ex 1JAN1960 or 31DEC2099 as default date.
Sam2022
Obsidian | Level 7
if the date is outside my range yes the graphs will be blank. however i don't want the text input to have date, i want it to be blank as well
Sam_SAS
SAS Employee

Hello,

 

I'm not completely sure why you would want to display missing values for the date.

 

If you assign a parameter to the text input, and you create a calculated item based on that parameter, I think that it would behave in the way that you want.

 

missing1.pngmissing.png

 

Note that creating date parameters is annoying and you must specify a minimum and maximum value. You can just put something like 01JAN1930  and 01JAN2100 if you want.

 

Let us know if that helps,

Sam

Sam2022
Obsidian | Level 7

I tried it but it doesn't work, these are the steps i did:

created the parameter:

Sam2022_0-1663056835328.png

then assigned it to the text input:

Sam2022_1-1663056899718.png

then created a calculated item based on this parameter:

Sam2022_2-1663057001947.png

then i added this calculated item to the table:

Sam2022_3-1663057095952.png

and now when i remove the date in text input the table gives error:

Sam2022_4-1663057202747.png

 

 

 

my point was when the user open the page there is no date shown in text input and table is blank

Sam2022
Obsidian | Level 7

I want the user see this when opening the page without any data

Sam2022_0-1663057647412.png

because the steps which creating parameter the assign to cal item will make the user see a date selected when opening the page

Sam_SAS
SAS Employee

Hello,

 

It works for me on Viya 4. From your screen captures, it looks like you have done everything correctly, although it appears you did not set up a filter action between the text input and the table.

 

Your screen captures show "An error occurred", and I wonder what that error is.

 

To get a completely empty table when the parameter  is not set, create an advanced filter on the Filters pane using the IsSet operator:

( 'Parameter 2'p IsSet )

 

missing2.png

 

I'm not sure if that will help until we figure out why you are getting this error, however.

 

Sam

Sam_SAS
SAS Employee
Actually, I see one odd thing in your screen captures. You have a datetime parameter, but it has a date format rather than a datetime format. Not sure if that could be an issue.
Sam2022
Obsidian | Level 7
i made the changes and set the format to date for all, but still i can see the error. (This error only shown while editing the report)
Sam2022
Obsidian | Level 7
where do i create the advanced filter? on the text input or table? Also, when i tried to do it either on table or text input the IsSet function gives error which is unknown function.
Sam_SAS
SAS Employee

The filter would go on the table. But if you don't have the IsSet function I think you must have a very old version of Visual Analytics.

 

Are you on 8.1 or older?

Sam2022
Obsidian | Level 7
Yes it's old version 7.5
Sam_SAS
SAS Employee

I get the same error you do when I try this on 7.5.

 

I think I have a workaround that might help.

 

1. Edit your parameter and set the current value to be something crazy like 01JAN1900.

2. Ensure the text input has a filter link to the list table on the Actions pane.

3. Make an advanced filter on the list table. Set the expression to select where the parameter value is NOT the current value from step 1 AND not missing. For me, this expression looked like: ( 'Parameter 1'p NotIn ('1JAN1900'd) ) AND ( 'Parameter 1'p NotMissing )

4. Do not include a calculated item based on the parameter in your list table. This will cause the "an error occurred" when the parameter value is not set.

 

In the screenshot below, the table is filtered when you enter a text value.

 

 

missing4.png

When no value is specified, the table is empty and the warning icon says "The filter resulted in an empty set of data". 

 

missing3.png

That is probably the closest we can get to what you want in 7.5.

 

Sam

Sam_SAS
SAS Employee
Actually, I have edited the previous post with a working workaround.
Sam2022
Obsidian | Level 7
Thanks SAM it works, however when user view the report the date is selected. is there any way to make it blank from start? or text input should have date?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 15 replies
  • 1718 views
  • 1 like
  • 3 in conversation