NOTE: Success Demonstrates BI Scope (the BI evolut.So, we've seen how we can zero-fill a data set using two different techniques, the first using all combinations of data within the input data set, and the second using a pattern of values from format(s). We add PRELOADFMT as an option to the CLASS statement, and here's the output that we get (new bits in red): We define a format for REGION which contains "West", but West is not in our data at all. See this example (key code highlighted in red): The formats associated with the CLASS variables are used to tell MEANS the full list of values. If there's a chance that your data won't contain all possible values for any given classification variable (this is a possibility when you regularly run reports on differing data), you might want to consider PRELOADFMT - it's a key word for the CLASS statement. If we run it without COMPLETETYPES we get:Īnd if we run it with COMPLETETYPES, we get (with the new information highlighted in red): Proc means data=sales /*completetypes*/ sum Region = 'South' product = 'Widget' sales = 100 OUTPUT Region = 'North' product = 'Foobar' sales = 300 OUTPUT Region = 'North' product = 'Widget' sales = 500 OUTPUT This can be very useful in presenting what appears to be a more complete picture of the input data and can be equally useful in presenting a consistent layout amongst a group of reports (or regularly produced reports). And PRELOADFMT will create combinations from values that don't even exist in your input data. It tells MEANS to create all possible combinations of the values of the classification variables, even if some of those combinations don't exist in the data. An oft overlooked parameter for PROC MEANS (and PROC SUMMARY) is COMPLETETYPES.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |