Hello,
I'm trying to simulate a Customer Journey in SAS VA.
I would like something like this:
ID | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore |
1 | Tel | A | 0 | - | - | - |
1 | Store | B | 1 | A | B | Tel |
1 | Tel | C | 0 | - | - | - |
1 | In | D | 0 | - | - | - |
1 | Store | B | 1 | D | B | In |
2 | Fax | D | 0 | - | - | - |
2 | C | 0 | - | - | - |
The DOIT variable is calculated when the same ID contact the company by wayOfContact <> Store and then Store. DOIT is 1 if wayOfContact is Store, 0 otherwise. If an ID contact the company only going to Store wayOfContact must be 0.
And it is possible to hav also other column:
- object of the request before Store (reqBefStore)
- object of the request during Store (reqInStore)
- wayOfContact before Store (wocBefStore)
Please help me.
Thank you
This is best done outside of VA using DATA step processing when preparing your VA load data. What have you tried so far?
Can you show using your sample data how your calculated columns would change if the filter was applied?
Hi,
if i wolud choose wayOfContact in (In , Store) the matrix would become:
ID | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore |
1 | Store | B | 0 | - | - | - |
1 | In | D | 0 | - | - | - |
1 | Store | B | 1 | D | B | In |
Any suggestion?
I don't know if i'm wrong but i think that theese requirements could be reached using a Sankey Diagram.
But i have nevere used it.
@FalkoSchulz would you help me?
I would add that i can add a date variable to my table.
But i have questions:
- if my data has no time values, and since it could be duplicated data value, is it possible to create a DOIT variable according to the sort the table showed?
- is it possible, using sankey diagram options,filter event (request) values and show the diagram based on given filter? Look at the table below:
Table i have:
ID | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore |
1 | Tel | A | 0 | - | - | - |
1 | Store | B | 1 | A | B | Tel |
1 | Tel | C | 0 | - | - | - |
1 | In | D | 0 | - | - | - |
1 | Store | B | 1 | D | B | In |
2 | Fax | D | 0 | - | - | - |
2 | C | 0 | - | - | - | |
3 | Fax | B | 0 | - | - | - |
3 | In | D | 0 | - | - | - |
3 | Store | B | 1 | D | B | In |
4 | In | E | 0 | - | - | - |
Table after filtering (only "In" and "Store"):
ID | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore |
1 | In | D | 0 | - | - | - |
1 | Store | B | 1 | D | B | In |
3 | In | D | 0 | - | - | - |
3 | Store | B | 1 | D | B | In |
4 | In | E | 0 | - | - | - |
Thank you
@FalkoSchulz i have this dataset:
ID | Date | wayOfContact | Request |
1 | 01/01/2018 | Tel | A |
1 | 02/01/2018 | Store | B |
1 | 03/01/2018 | Tel | C |
1 | 04/01/2018 | In | D |
1 | 05/01/2018 | Store | B |
2 | 05/01/2018 | Fax | D |
2 | 10/01/2018 | C | |
3 | 01/01/2018 | Fax | B |
3 | 02/01/2018 | In | D |
3 | 03/01/2018 | Store | B |
4 | 02/01/2018 | In | E |
5 | 04/01/2018 | Store | A |
and i would like something like this:
ID | Date | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore | nDaysPrevRow |
1 | 01/01/2018 | Tel | A | 0 | - | - | - | |
1 | 02/01/2018 | Store | B | 1 | A | B | Tel | 10 |
1 | 03/01/2018 | Tel | C | 0 | - | - | - | |
1 | 04/01/2018 | In | D | 0 | - | - | - | |
1 | 05/01/2018 | Store | B | 1 | D | B | In | 3 |
2 | 05/01/2018 | Fax | D | 0 | - | - | - | |
2 | 10/01/2018 | C | 0 | - | - | - | ||
3 | 01/01/2018 | Fax | B | 0 | - | - | - | |
3 | 02/01/2018 | In | D | 0 | - | - | - | |
3 | 03/01/2018 | Store | B | 1 | D | B | In | 2 |
4 | 02/01/2018 | In | E | 0 | - | - | - | |
5 | 04/01/2018 | Store | A | 0 | - | - | - |
If wayOfContact in ('Store','In') filter is applied could become:
ID | Date | wayOfContact | Request | DOIT | reqBefStore | reqInStore | wocBefStore | nDaysPrevRow |
1 | 02/01/2018 | Store | B | 0 | - | - | - | |
1 | 04/01/2018 | In | D | 0 | - | - | - | |
1 | 05/01/2018 | Store | B | 1 | D | B | In | 3 |
3 | 02/01/2018 | In | D | 0 | - | - | - | |
3 | 03/01/2018 | Store | B | 1 | D | B | In | 2 |
4 | 02/01/2018 | In | E | 0 | - | - | - | |
5 | 04/01/2018 | Store | A | 0 | - | - | - |
Is it possible to have this in sas va?
is it possible to have it using sankey diagram ?
If you prefer a Sankey diagram then how you are trying to restructure your data isn't required, I suspect. What version of VA are you using? Up to Version 7.4 Sankey diagrams are only available as visualisations which you can export to a VA report:
I'll leave it up to those who know more about these diagrams to comment further
Unfortunately there are some limitations in terms how row-based calculations can be done in VA. You have a related discussion here: Re: SAS Visual Analytics create a Sequence variable
You can certainly use your original table straight as input to path analysis (sankey diagram) - it would render similar to this:
Note, that a sankey diagram is really designed to be used on high volume data so you rarely look at an individual but rather at the overall customer journey here. For example, what percentage of my customers first contact by phone and then visit a store? How many customers do not come back (contact) after visiting a store? How many purchase a product? etc.
The sankey diagram shows you the total count (small numbers to the start and the end of a path) taking this particular step.
No, the labeling in a sankey diagram is done given the event identifier. in your example this is probably 'wayOfContact'. You can however use special path filters here to identify a particular path(s) of interest. For more detailed investigation - you can create other visualizations given a path or event selection (e.g. bar chart showing the customers behind this path). Such visualization can have additional labels, measures etc to describe this path subset.
Hope this helps. Falko
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.