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?
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.
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.
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.