Public
Edited
Feb 11, 2021
Importers
Insert cell
Insert cell
Insert cell
data = fetch("https://opendata.nhsbsa.net/api/3/action/package_show?id=secondary-care-medicines-data")
.then(function(response){
return response.json();
})
Insert cell
d = await fetch("https://opendata.nhsbsa.net/dataset/d5d7cd63-5373-4a0e-ae22-7f1a198e305d/resource/af2dce7f-e04c-4d01-bd5c-bab0e003d654/download/scmd_201901.csv")
Insert cell
Insert cell
realData=data.result.resources
Insert cell
Insert cell
function optionOne(x){
let splits = (x).split('_')
return splits[1]
}
Insert cell
optionOne("SCMD_201901")
Insert cell
function optionTwo(x){
let splits = (x).split('- ')
return splits[1]
}
Insert cell
optionTwo("Secondary Care Medicines Data (SCMD) - Jan 2019")
Insert cell
Insert cell
linksTable = realData
.map(({title, url})=>({date:optionTwo(title) , link:url}))
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more