2 weeks ago
andypandy_swe
Obsidian | Level 7
Member since
05-02-2017
- 53 Posts
- 15 Likes Given
- 1 Solutions
- 10 Likes Received
-
Latest posts by andypandy_swe
Subject Views Posted 201 03-07-2025 04:55 AM 443 02-19-2025 02:59 AM 453 02-19-2025 02:55 AM 1252 02-18-2025 07:11 AM 795 01-28-2025 09:55 AM 848 01-28-2025 02:22 AM 1002 12-13-2024 03:29 AM 1526 06-08-2023 11:50 AM 1546 06-08-2023 11:21 AM 1550 06-08-2023 11:17 AM -
Activity Feed for andypandy_swe
- Got a Like for Hide legend entries for missing data.. 3 weeks ago
- Got a Like for Hide legend entries for missing data.. 3 weeks ago
- Got a Like for Hide legend entries for missing data.. 3 weeks ago
- Posted Hide legend entries for missing data. on SAS Product Suggestions. 03-07-2025 04:55 AM
- Tagged Hide legend entries for missing data. on SAS Product Suggestions. 03-07-2025 04:55 AM
- Tagged Hide legend entries for missing data. on SAS Product Suggestions. 03-07-2025 04:55 AM
- Tagged Hide legend entries for missing data. on SAS Product Suggestions. 03-07-2025 04:55 AM
- Posted Re: Calculated item without format? on SAS Visual Analytics. 02-19-2025 02:59 AM
- Posted Re: Calculated item without format? on SAS Visual Analytics. 02-19-2025 02:55 AM
- Posted Dynamically change the selected value of a button? on SAS Visual Analytics. 02-18-2025 07:11 AM
- Posted Re: Can I create a parameter that holds other/different/unformatted value? on SAS Visual Analytics. 01-28-2025 09:55 AM
- Posted Can I create a parameter that holds other/different/unformatted value? on SAS Visual Analytics. 01-28-2025 02:22 AM
- Posted Calculated item without format? on SAS Visual Analytics. 12-13-2024 03:29 AM
- Posted Re: Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 11:50 AM
- Posted Re: Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 11:21 AM
- Posted Re: Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 11:17 AM
- Posted Re: Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 11:15 AM
- Posted Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 05:57 AM
- Tagged Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 05:57 AM
- Tagged Proc report: Analysis variable before across doesn't work. on SAS Procedures. 06-08-2023 05:57 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2 2 1 -
My Liked Posts
Subject Likes Posted 3 03-07-2025 04:55 AM 1 10-07-2020 04:54 AM 1 05-11-2020 06:44 AM 1 04-10-2019 04:34 AM 3 12-11-2018 03:15 AM
03-07-2025
04:55 AM
3 Likes
In VA I have a line chart over time (x-axis) that displays the results of different KPIs (y-axis) according to a selection in a listbox. All KPIs have "Value" and "Average" and some have a "Target value". If I add the three roles, then I get a legend item for Target value even if the currently shown KPI doesn't have one (it's missing in the data). Preferably one would like to choose to display or not display the legend item when data is missing.
Second best would (in my opinion) be to never display the legend item for missing data.
This would, again in my opinion, be needed for all chart objects.
Regards
Andreas
... View more
- Find more ideas tagged with:
- Hide legend item
- legend
- missing data
See more ideas labeled with:
02-19-2025
02:59 AM
The user will have no way of knowing if it's a percent graph or an index graph so they'd have to klick the tabs to find the graph after making the selection... This was considered but rejected.
We went with displaying the unit in the graph name using a textbox with a parameter instead. Not perfect but it's something. Thinking about sending in a feature request to SAS so that you can allow a calculated object to inherit the format (and also sort order) of another object...
... View more
02-19-2025
02:55 AM
It's a barchart so the percent sign would be on the axis label (and possibly the tooltip). I've been unable to solve it so my workaround is have a textbox with a parameter holding the type of value (% or index) above the graph. Far from perfect but I think it's the best one can do in this version of VA. I think a dual axis would only be confusing...
... View more
02-18-2025
07:11 AM
I have some data that contains an ID and a TYPE and then some measures that are displayed in a barchart.
The data looks like this:
ID TYPE MEASURE 600 A 36,2 600 B 12,8 700 A 18,0 700 B 44,4 ... To filter the barchart I have a select-list for the ID and buttonbar for the TYPE (A and B). I now want to have a specific default value for the button bar that depends on the ID. So that say the ID is 600 then the TYPE-button should have A selected but if I choose 700 then the B-button should be selected. This pairing comes from a lookup-table that I have joined with my data so there is now a TYPE_DEFAULT column as well.
ID TYPE TYPE_DEFAULT MEASURE 600 A A 36,2 600 B A 12,8 700 A B 18,0 700 B B 44,4 ... The only way to control what item in the button bar is highlighted/selected seems to be to select that the "first" item should be highlighted/selected. I figured it was ok if the order of A and B switched depending on the selected ID so my plan was to dynamically change the order. I therefore renamed TYPE to TYPE A-B and set a custom sort on it so that A comes before B. I then cloned that variable, called it TYPE B-A and set a custom sort on that where B comes before A. I then created a calculated item A-B-A that says IF ( 'TYPE_DEFAULT'n = 'A' ) RETURN 'TYPE A-B'n ELSE 'TYPE B-A'n I then set the button bar to use the calculated A-B-A -variable instead, but it doesn't work. When I select an ID in the dropdown list that is associated with the default value A, the button bar doesn't switch the order of the buttons. However if I assign the TYPE A-B variable directly to the button bar, then the A-button comes first and is highlighted. The same the other way around so if I assign TYPE B-A, the B-button comes first and is highlighted. So obviously the calculated item doesnt inherit the sort order of the variable it returns and my solution is a fail. Can someone think of another solution? Many thanks
... View more
01-28-2025
09:55 AM
I found that I could have the dropdown list displaying countryName and then add another dropdownList with countryID that is filtered by the first one (countryName and CountryID are in the same table). The second one then sets a parameter containing the ID instead of the name. I guess I'll try and hide the countryID -list somewhere... It works reasonably well but I'd be interested in a better solution if anyone has one.
... View more
01-28-2025
02:22 AM
I have a dropdown list of country names. The selected country is placed in a parameter for use elsewhere. However I would like the parameter to hold countryID instead of countryName, but still display the country name in the dropdown list. I tried a a character format on countryID ('46' = 'Sweden') and set the dropdownlist to use countryID but the parameter then contains the formatted value so that didn't work. Is there a way to do this?
... View more
12-13-2024
03:29 AM
I have a table (simplified) with three columns: id
group
value
unit
I'd like a barchart which shows value per group when i select 'id' from a dropdown list.
Unit can have the values '%' or 'amount'.
So I'd like the graph to show the value as a percentage (multiplied by 100 and with a percent-sign) if unit='%' and as the original value if unit='amount'. I created a calculated item called value_pct that takes value and multiplies by 100. I then create another calculated item called SWITCH that checks the value of Unit and if it's '%' it returns value_pct, otherwise it returns value. Switch has the format comma12.2
I then use SWITCH in the graph. This works but I'm not getting a percent sign of course... If I instead define value_pct only as the variable 'value' but with a percent format. Then the SWITCH item won't work in the graph.
Presumably because The format of SWITCH overrides the percent format of value_pct... Is there a way around this? Create switch without a format? Or is there a completely different, better way to do what I want?
... View more
06-08-2023
11:50 AM
Ok, I tried outputting a dataset to see what is happening. It turns out that (if I remove the noprint for year_month) I see one column in the result but the produced dataset has like 255 columns. I'm guessing it's the number of different year_month -values that is ouside the range. So proc report creates an across for this variable too but hides it. The reason I didn't get anything in my summary columns was that the "inside" columns started at _C256_!
... View more
06-08-2023
11:21 AM
So the sums should be like this:
... View more
06-08-2023
11:15 AM
I just discovered that if there is a date (any date) in the outside registrations (the two in the included test data with missing dates) then it works. I don’t know why… You can see what it’s supposed to look like by changing those two missing values to some dates. However, when I run the same code with production data there is nothing in any of the two summary columns... Real data has 18000 registrations within the timeframe and around 211000 outside the timeframe... Can't really understand why it works with test data but not a larger dataset.
... View more
06-08-2023
05:57 AM
I rarely use proc report but now I need to and I can't figure out how to write this... I have a report that needs to show number of registrations per month for months that fall within a set timeperiod.
There are some grouping variables and then the months (only the ones where there is at least one registration) as columns and then two summary columns.
The first should calculate the number of registrations (for each group) that falls within the timespan.
The second should calculate the same + the number of registrations that fall outside of the timespan (for each group). The registrations outside the timeperiod don't have a month-value.
My thinking so far:
In order to first sum the columns except for the "outside timespan" I think I need to have "outside timespan" first and summarize all the columns that come after it (as the number of "inside" columns are dynamic). Then I create another summary column that starts with the "outside" column first and sums up all columns that comes after it (only then the first summary column is also included so I have to deduct that from the total. Below is some sample code. With parts of the code commented I get the correct result in the "ouside timespan" column according to the input data. One registration for group 1A-2F-3K and one for group 1B-2J-3R However when I try to do an across efter the "ouside" column with the "inside" columns below it... The values for the "outside" column disappears and both summary columns show the same value (when the second should show more registrations). The "outside" column is only in the report for calculating the second summary column... It's shouldn't be visible in the final report... Any tips on what I'm doing wrong or how to solve it another way would be greatly appreciated. /Andreas
data work.registrations;
input group1 $ group2 $ group3 $ year_month date9. inside_timespan outside_timespan;
format year_month yymmd7.;
datalines;
1A 2F 3K 0 1
1A 2G 3K 01jan2020 1 0
1A 2G 3K 03feb2020 1 0
1A 2G 3L 07apr2020 1 0
1A 2H 3M 20may2020 1 0
1A 2H 3M 02jun2020 1 0
1A 2H 3M 01jul2020 1 0
1A 2H 3N 09jul2020 1 0
1B 2I 3O 12jul2020 1 0
1B 2I 3P 01aug2020 1 0
1B 2I 3Q 01aug2020 1 0
1B 2J 3R 0 1
1B 2J 3R 04sep2020 1 0
1B 2J 3S 07sep2020 1 0
;
run;
proc report data=work.registrations nowd
style(summary)=Header;
column group1
group2
group3
outside_timespan
/* year_month, inside_timespan tot_inside tot_all */;
define group1 / group 'Group 1' missing order=formatted style(column)=Header ' ';
define group2 / group 'Group 2' missing order=formatted style(column)=Header ' ';
define group3 / group 'Group 3' missing order=formatted style(column)=Header ' ';
define outside_timespan / analysis sum format=6. width=8 /*noprint (will be hidden in finished report)*/;
/* define year_month / across order=formatted 'Year/Month';
define inside_timespan / analysis sum format=6. width=8 ' ';
define tot_inside / computed format=8. 'Total inside period';
define tot_all / computed format=8. 'Total inside and outside period';
rbreak after / summarize;
compute tot_inside;
tot_inside = sum(_C5_,_C6_,_C7_,_C8_,_C9_,_C10_,_C11_,_C12_);
endcompute;
compute tot_all;
tot_all = sum(_C4_,_C5_,_C6_,_C7_,_C8_,_C9_,_C10_,_C11_,_C12_) - tot_inside;
endcompute; */
by group1;
run;
quit;
... View more
06-02-2022
05:45 AM
Did you solve it?
I'm struggling with the same thing...
I'm using stat=mean on a variable containing 1/0 (formatted with percent8.) to get percentages (because I want upper and lower clm. The datalabel options gives the formatted value on the middle row but the upper limit and lower limit value is in decimal... Any way to change these to percent?
... View more
08-17-2021
02:50 AM
I tried your code yesterday and it didn't work... Got the same result. Today it works. Must have had en EG hangup. Thanks!
... View more
08-16-2021
11:30 AM
Hi!
When trying to include a format in another format I get a note saying: NOTE: The $FIRSTFORMAT (in)format was specified on the right-hand side of an equal sign, but without a length specification. PROC FORMAT will assume a default length of at least 40 for the format being generated. If this is an insufficient width, you can rerun PROC FORMAT with an explicit width for the $FIRSTFORMAT (in)format, or provide a sufficient DEFAULT= option.
The Code looks something like this:
proc format lib=format.userformat; value $firstformat '3'='ThisIsAStringThatIsMoreThanFortyCharactersLong' ; run;
proc format lib=format.userformat; value $secondformat '1'='AShortString' '2'='AlsoAShortString' other=[$firstformat.] ; run;
data test; length value $255.; format value $secondformat.; value='1'; output; value='2'; output; value='3'; output; run; The value '3' is truncated to 40 characters... What am I doing wrong? I've tried putting a "default=50" after the value -statement (in both formats) but it doesn't seem to be doing anything.
How do I set an "explicit width for the $FIRSTFORMAT (in)format" or "provide a sufficient DEFAULT= option"?
The above code is obviously just an example... In reality the firstformat is created from a file and contains a lot of values, most of whom are longer than the values in secondformat.
... View more