BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rudfaden
Lapis Lazuli | Level 10

Can anybody please give me a hint to why my attribute map is not working?

 

data sygefravaer;
    input org1 $ aar frvpct;
    datalines;
       BIH 2008 0.054808
       BIH 2009 0.055320
       BIH 2010 0.052181
       BIH 2011 0.048537
       BIH 2012 0.044407
       BIH 2013 0.045194
       BIH 2014 0.044820
       BIH 2015 0.047625
       BIH 2016 0.043911
       BIH 2017 0.041832
       BOH 2008 0.047234
       BOH 2009 0.048923
       BOH 2010 0.045335
       BOH 2011 0.041233
       BOH 2012 0.037196
       BOH 2013 0.048197
       BOH 2014 0.041970
       BOH 2015 0.040119
       BOH 2016 0.037073
       BOH 2017 0.043347
       HAN 2008 0.067321
       HAN 2009 0.067417
       HAN 2010 0.064484
       HAN 2011 0.061578
       HAN 2012 0.063485
       HAN 2013 0.056805
       HAN 2014 0.058914
       HAN 2015 0.063266
       HAN 2016 0.064831
       HAN 2017 0.062269
       HEH 2008 0.051338
       HEH 2009 0.052693
       HEH 2010 0.051506
       HEH 2011 0.046498
       HEH 2012 0.044183
       HEH 2013 0.043885
       HEH 2014 0.045182
       HEH 2015 0.045543
       HEH 2016 0.042784
       HEH 2017 0.043929
       HVH 2008 0.053729
       HVH 2009 0.050651
       HVH 2010 0.050757
       HVH 2011 0.046209
       HVH 2012 0.043999
       HVH 2013 0.042450
       HVH 2014 0.043704
       HVH 2015 0.046561
       HVH 2016 0.045978
       HVH 2017 0.045988
       NOH 2008 0.058046
       NOH 2009 0.056435
       NOH 2010 0.054261
       NOH 2011 0.051954
       NOH 2012 0.051563
       NOH 2013 0.053010
       NOH 2014 0.050787
       NOH 2015 0.052280
       NOH 2016 0.052086
       NOH 2017 0.049857
       RIH 2008 0.046773
       RIH 2009 0.047331
       RIH 2010 0.043580
       RIH 2011 0.042840
       RIH 2012 0.040495
       RIH 2013 0.041050
       RIH 2014 0.042356
       RIH 2015 0.043788
       RIH 2016 0.043234
       RIH 2017 0.044060
       ÅÅÅ 2008 0.054585
       ÅÅÅ 2009 0.053936
       ÅÅÅ 2010 0.051457
       ÅÅÅ 2011 0.048624
       ÅÅÅ 2012 0.046065
       ÅÅÅ 2013 0.045541
       ÅÅÅ 2014 0.045435
       ÅÅÅ 2015 0.047224
       ÅÅÅ 2016 0.045546
       ÅÅÅ 2017 0.045474
;
run; 


proc sql;
    /*  dataattrbute map */
    create table attrmap (ID char(4), value char(3),linethickness num(1), linecolor char(9), linepattern char(30));
        insert into attrmap
            values('org' 'NOH' 4 'green'   'solid')
            values('org' "ÅÅÅ" 2  'orange'  'MediumDashShortDash')
            values('org' "HVH" 2  'blue'    'solid')
            values('org' "BIH" 2  'red'     'solid')
            values('org' "HEH" 2  'orange'  'solid')
            values('org' "RIH" 2  'pink'    'solid')
            ;
quit;

proc sgplot data=sygefravaer dattrmap=attrmap;
    where org1 in ('ÅÅÅ', 'HVH', 'BIH','HEH', 'NOH','RIH');
    series x=aar y=frvpct /group=org1 nomissinggroup markers attrid=org;
    xaxis type=discrete grid label=' ';    
    yaxis  label="Sygefravær (%)" grid;
    refline 0.045 / transparency = 0.3
                    label = ('Målsætning');
    format org1 $org1fmt. frvpct percent10.1;
    keylegend /title=''  noborder;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
rudfaden
Lapis Lazuli | Level 10

I found the problem. I sued the non formatted values in the attribute map. I should use the formatted values.

View solution in original post

4 REPLIES 4
Rick_SAS
SAS Super FREQ

Sure, we are happy to help. Please indicate what you mean by "my attribute map is not working." When I run your code I see line patterns, thickness, and colors that are the same as the attribute map. Here is what I see:

 

SGPlot.png

 

Please tell if this is this what you see. 

1. If so, what describe what you expect or want to see.

2. If not, please describe (or post) what you see and tell us your SAS version.

 

rudfaden
Lapis Lazuli | Level 10

When I run it, the attribute map has no effect. But as it works with you, I migth try agian

Rick_SAS
SAS Super FREQ

I'll repeat my suggestion:

 

==> If not, please describe (or post) what you see and tell us your SAS version.

rudfaden
Lapis Lazuli | Level 10

I found the problem. I sued the non formatted values in the attribute map. I should use the formatted values.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1325 views
  • 0 likes
  • 2 in conversation