BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi. Could someone please let me know how do I count the number of measures in my dataset? I am using the PVA data and I can physically count them but is there a function or anywhere where it shows how many measures are in the data? Thank you.

Super User

Do you mean to count the non-missing values in a variable/column?

If yes, procedures SUMMARY, FREQ, TABULATE, REPORT can all calculate counts. In SQL, use count(var).

For more detailed help, post example data in usable form (data step with datalines, posted in a code box), and show what you expect to get out of it (report or new dataset).

Calcite | Level 5

Hi. No, I mean how do I know the ocunt of measures that show up in the Data tab when I go in "explore and visualize".
For example, this image ( has 6 measures that I can count on my fingers. Is there a formula that tells me that there are 6?

Calcite | Level 5

Yes, it is.




What do you want to do with the count value? If you want to use it in calculations / filters, I believe you would need to precalculate the value in the data preparation stage by using PROC SQL or another of the procedures mentioned earlier.


If you only need to display the value in your report and you have a very recent version of VA (2021.1.1 or later) you could use the Job Content object to display the results of a SAS language job (using the same procedures such as PROC SQL.) 


I am actually not completely sure if you can programmatically make the distinction between measures (numeric variables) and categories (character variables). I'm not sure if that is a requirement for you, or if a count of all columns in the data would be sufficient.



Calcite | Level 5
Thank you for your response. I just wanted to know if there is somewhere where it is shown visually, without calculations. For example, the way it shows the count of records against each category. From exploring SAS and the forums, I think it is not possible.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 7 replies
  • 3 in conversation