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.
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).
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 (https://imgur.com/a/0o85ahl) has 6 measures that I can count on my fingers. Is there a formula that tells me that there are 6?
So this is a Visual Analytics question?
Yes, it is.
I moved this to the VA community and edited the subject lines. Since I don't use VA, someone else will need to chime in. Calling @Madelyn_SAS @Sam_SAS
Hello,
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.
Sam
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!
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.