BookmarkSubscribeRSS Feed
smm662002
Quartz | Level 8

Hello,

 

SAS VIYA:                  3.5         

SAS Visual Analytics: 8.5

 

Having a table with the following structure (table is loaded in CAS) would it be possible to create a bar chart like in the example below without having to create new a new table (in SAS Studio) to summarise the data? I'm wondering if it is possible to manipulate the data only in SAS Visual Analytics.

 

V1 V2 V3

0

0 0
1 0 0
1 0 0
1 1 1
1 1 1
0 1 0
1 1 0
1 1 1
  1 0
  1 0
  1  

 

smm662002_0-1639393193463.png

 

 

Thank you,

smm662002

 

 

 

 

4 REPLIES 4
LinusH
Tourmaline | Level 20

Hi, 

I'm not good enough in VA to tell if this would work or not, but the data presented is not in optimal layout for reporting generally speaking.

Any classifier should be a value in a classifer column, not a variable/column itself.

So I would create a "Vn" column, with values 1, 2 and 3 respectively.

This will give you more flexibility when creating reports, and also being more tolerant for New V's (V4 etc).

Data never sleeps
smm662002
Quartz | Level 8

Hi,

 

Thank you for your answer. The data presented in the post is just an extract from a larger table having over 100 columns and a few million records. This data is calculated data rather than raw data. The data can have further transformations, but the question was if the desired chart can be created in SAS Visual Analytics using the data as it is now.

 

Thank you,

smm662002

    

acordes
Rhodochrosite | Level 12

It's not a lucky design choice to have the category or group items as variables, in this case v1, v2, v3.

Your table should be transposed as it is in wide format but you need a long format. 

ok.png

 

 

data test1;
array x  v1 v2 v3;
do i=1 to 50;
do over x;
x=rand("bernoulli", 0.8 + min(0.2, max(-0.8, rand("normal", 0,1))));
end;
output;
end;

run;

proc transpose data= test1 out=test2;
var v:;
by i;
run;

data public.test2(promote=yes);
set test2;
run;
LinusH
Tourmaline | Level 20

Now I had some time to play around.

And I can't see that this can be done OOTB.

Since your data is already calclated you might be able to adjust that, so it suits general reporting/analysis needs.

As stated intially, and by @acordes, make life easier by transposing your data.

Data never sleeps

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 4 replies
  • 1323 views
  • 2 likes
  • 3 in conversation