BookmarkSubscribeRSS Feed
gabras
Pyrite | Level 9
Hi is it possibile to reuse a calcolare data item in further visualization?
I have
CustId. ID
1. 1
1. 2
2. 3
3. 4

And i want

CustId Count
1. 2
2. 1
3. 1

And i watt to reuse Count in order to count how many Cust have tua distinct value of count. So:

Count CountDistCustid
1. 2
2. 1

How can i do it using VA 7.3?
I thougth also about creating a sequence variable but it seems not possible in VA.

Thank you
6 REPLIES 6
SASKiwi
PROC Star

This can be easily done in SQL outside of VA as two separate tables, then loaded into VA.

 

What type of reports do you want to do? Some reports will do counts without the need to prepare your data.

gabras
Pyrite | Level 9
Hi @SASKiwi,

You are rigth, it is Simone outside VA. But if you build it outsider va,the report in the VA will be static. You even can’t change the the period of time otherwise there is a risk that the column calculated out of the VA is completely wrong
gabras
Pyrite | Level 9
@SASKiwi i would like to have a report that counts how many CustId had that amount of Interaction with the company. But i would like to see the same thing in a different period of time.
SASKiwi
PROC Star

@gabras - If you want a solution that has a time dimension you need to add that to the data you posted so I know what your complete requirements are. As long as you summarise to the lowest level of granularity in your time dimension then that will work fine in VA. I have done this myself.

gabras
Pyrite | Level 9

Hi @SASKiwi

 

let's say i have 

IDCUSTIDDATE
1101/01/2018
2101/02/2018
3102/02/2018
4202/01/2018
5203/01/2018
6304/02/2018
7305/02/2018

 

and i want  to count how may interaction per custid

 

CUSTIDCount
13
22
32

 

 

and then how may distinct CF have that amount of count

 

CountCountDistCustId
22
31

 

 

Now, i want to filter the data from february 2018 and so the different tables should become:

 

IDCUSTIDDATE
1101/02/2018
2102/02/2018
3304/02/2018
4305/02/2018

 

CUSTIDCount
12
32

 

 

CountCountDistCustId
22

 

 

 

i hope it is clear

 

 

Thank you

SASKiwi
PROC Star

If I understand your customer count correctly, something like this should work. When you then apply a filter on date VA will only include the customer counts that obey the filter.

 

proc sql;
  create table want as 
  select date
        ,custid
        ,count(*) as Count
  from have
  group by date
          ,custid
  ;
quit;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 1086 views
  • 0 likes
  • 2 in conversation