03-28-2017 08:15 PM
I have just started using SAS Dataflux for Data analysis, so I am not too familiar with work arounds in SAS.
I have created a profile of a table with just two fields. One field consists of unique code for products and another field consists of date these products were created on. I want to count products for each month of each year and present it in a graph. I have managed to create a graph for numbers of products for each year but having trouble to do it for each month of each year.
Below is how a table looks like where field ERSDA is for date
I wrote a custom metric as below
public integer articleCount2013 public integer articleCount2014 public integer articleCount2015 public integer articleCount2016 public integer articleCount2017 articleCount2013 = 0 articleCount2014 = 0 articleCount2015 = 0 articleCount2016 = 0 articleCount2017 = 0 if left(`ERSDA`,4)=="2013" begin articleCount2013 = articleCount2013 + 1 end else if left(`ERSDA`,4)=="2014" begin articleCount2014 = articleCount2014 + 1 end else if left(`ERSDA`,4)=="2015" begin articleCount2015 = articleCount2015 + 1 end else if left(`ERSDA`,4)=="2016" begin articleCount2016 = articleCount2016 + 1 end else if left(`ERSDA`,4)=="2017" begin articleCount2017 = articleCount2017 + 1 end
Could anyone please assist in doing this a better way and creating a graph with numbers of products for each month of each year ? And, I am using DatafluxData Management Studio Version : 188.8.131.52
Thanks in advance for you help.
03-28-2017 08:41 PM
Dataflux is used for data management, less so visualization, usually that would be Base SAS.
I've moved this thread to the Data Management forum, where Dataflux users are more likely to see it.