Is there a way to select fields that are grayed out on the Socrata web client? - socrata

I am attempting to get the compared_to_national column for the readmission data located at Data.Medicare.gov
This column is grayed out on the web interface making me think that it is a computed field or a join with another table.
$ curl https://data.medicare.gov/resource/7xux-kdpw? | grep national
shows that this value is not being returned at all even when everything is selected. Am I missing something here or is this data just not available?

Sorry for the late reply, but maybe I can still help out.
The greyed out values are data that was incompatible with the selected datatype at import time. In the case of Readmissions Complications and Deaths - Hospital, that's textual data that the data owner attempted to import into a Numeric column type.
Unfortunately it isn't queryable, but I'll let the account manager for CMS know so that hopefully they can have that fixed.

Related

Azure Data Factory copy nested JSON to SQL table

Does anyone have an easy way to convert nested JSON to a flat SQL table? Just want to repeat the higher level data on each of the lower level detail. It looks like it can be done in mapping, I have tried as per the MS documentation but got a table full of NULL. Here is what I have tried and the result.
json
Option 1
Result: Only returns the first record of the ‘assignedLicences’
Option1
Option 2:
Returns multiple ‘assignedLicenses’ for each user, but only returns the first user id in each page.
Option2
Option3: as per the MS documentation
Result: returns all NULL values
Option3
You can have a try:
1.click import schemas button
2.if you have a JsonArray,select it.
3.you can directly see and edit the fields' JSON paths by opening Advanced editor .
Here is a Microsoft documentation about it.Please refer to this.
Hope this can help you.

Query Google Admin User directory comparing parameters

I'm trying to filter my users list by comparing two parameters
query="EmployeeData.EmployeeID=externalId"
EmployeeData.EmployeeID is a custom schema that is populated, with a cron job, with the same value as externalId.
Of course I let the cron do the field copy only if necessary, this is the reason I'm trying to filtering the users list.
In the way i wrote seems that the query trying to looking for a value "externalId" into the EmployeeData.EmployeeID ignoring that "externalId" is a even a field
any suggestion?
The way your code is written, the query sent to Google's servers is as you correctly guessed the following:
EmployeeData.EmployeeID=externalId where your actual externalId is not sent but rather the string "externalId".
To replace this string for the actual value of your variable, you can use what is called "string concatenation" 1. To do it, you just need to modify your code as shown below:
query="EmployeeData.EmployeeID=" + externalId;
This way, the query will be sent as you need to Google's servers.

Best way to parse a big and intricated Json file with OpenRefine (or R)

I know how to parse json cells in Open refine, but this one is too tricky for me.
I've used an API to extract the calendar of 4730 AirBNB's rooms, identified by their IDs.
Here is an example of one Json file : https://fr.airbnb.com/api/v2/calendar_months?key=d306zoyjsyarp7ifhu67rjxn52tv0t20&currency=EUR&locale=fr&listing_id=4212133&month=11&year=2016&count=12&_format=with_conditions
For each ID and each day of the year from now until november 2017, i would like to extract the availability of this rooms (true or false) and its price at this day.
I can't figure out how to parse out these informations. I guess that it implies a series of nested forEach, but i can't find the right way to do this with Open Refine.
I've tried, of course,
forEach(value.parseJson().calendar_months, e, e.days)
The result is an array of arrays of dictionnaries that disrupts me.
Any help would be appreciate. If the operation is too difficult in Open Refine, a solution with R (or Python) would also be fine for me.
Rather than just creating your Project as text, and working with GREL to parse out...
The best way is just select the JSON record part that you want to work with using our visual importer wizard for JSON files and XML files (you can even use a URL pointing to a JSON file as in your example). (A video tutorial shows how here: https://www.youtube.com/watch?v=vUxdB-nl0Bw )
Select the JSON part that contains your records that you want to parse and work with (this can be any repeating part, just select one of them and OpenRefine will extract all the rest)
Limit the amount of data rows that you want to load in during creation, or leave default of all rows.
Click Create Project and now your in Rows mode. However if you think that Records mode might be better suited for context, just import the project again as JSON and then select the next outside area of the content, perhaps a larger array that contains a key field, etc. In the example, the key field would probably be the Date, and why I highlight the whole record for a given date. This way OpenRefine will have Keys for each record and Records mode lets you work with them better than Row mode.
Feel free to take this example and make it better and even more helpful for all , add it to our Wiki section on How to Use
I think you are on the right track. The output of:
forEach(value.parseJson().calendar_months, e, e.days)
is hard to read because OpenRefine and JSON both use square brackets to indicate arrays. What you are getting from this expression is an OR array containing twelve items (one for each month of the year). The items in the OR array are JSON - each one an array of days in the month.
To keep the steps manageable I'd suggest tackling it like this:
First use
forEach(value.parseJson().calendar_months,m,m.days).join("|")
You have to use 'join' because OR can't store OR arrays directly in a cell - it has to be a string.
Then use "Edit Cells->Split multi-valued cells" - this will get you 12 rows per ID, each containing a JSON expression. Now for each ID you have 12 rows in OR
Then use:
forEach(value.parseJson(),d,d).join("|")
This splits the JSON down into the individual days
Then use "Edit Cells->Split multi-valued cells" again to split the details for each day into its own cell.
Using the JSON from example URL above - this gives me 441 rows for the single ID - each contains the JSON describing the availability & price for a single day. At this point you can use the 'fill down' function on the ID column to fill in the ID for each of the rows.
You've now got some pretty easy JSON in each cell - so you can extract availability using
value.parseJson().available
etc.

Power BI and JSON data

Is it possible to make Power BI read JSON data? I've spent an entire day yesterday to figure out how to convert the JSON data into a readable table in Power Bi, but with no luck.
I tried googling for hours, but there is no proper documentation anywhere.
I'm retrieving a JSON payload from my website and when I try to import, it shows the data like this:
Record
Record
Record
Record
Maybe there are any tutorials I can follow? Or perhaps another alternative to Power BI that would properly read and structure my JSON data?
As mentioned in comments, just besides each Record (if headers), are you able to see any small box with two arrows, try clicking it.
This Answer may help now..
First We have to convert this to table ->Click on the Icon in top left corner
Properties window will open. dont change anything Click on Ok.Now you can see the list converted to Column.
There is an arrow icon in the column -> Click on it
Main Step :In the property window uncheck "use original column name as prefix"
Here we go You can now use this result !
Refer Below Links :
https://www.mssqltips.com/sqlservertip/4621/using-power-bi-with-json-data-sources-and-files/
https://www.dutchdatadude.com/loading-multiple-json-files-using-power-query/
Retrieving data from a .json file brings in 'Records'. Each row of data is returned as a 'Record' which is a List. Each record in 'Records' is a hyperlink that opens the row elements. You could convert the 'Records' into a table, but you get a Table with a single column which has all the records with each record a row from the original JSON data.
Here is a link to few more details:
http://hodentekmsss.blogspot.com/2016/11/retrieving-json-data-in-power-bi.html

MySQL for Excel TIME Column

I wanted to check in here to see if anyone has any suggestions before submitting a bug report to Oracle.
I'm using MySQL for Excel in Excel 2013, and when trying to import a table that has a TIME type column, the import fails and I get the following error message:
An error occurred when trying to import the data.
Method's type signature is not Interop compatible.
I looked up information about Method's type signature is not Interop compatible. but found only things relating to C/C#.
I'm trying to insert data that is formatted as a relative time duration, e.g. 00:02:34 (2 minutes 34 seconds), but I cannot find a way to do this. MySQL for Excel won't import a TIME column, and when I define the column as VARCHAR, it does some calculation on each value when it's submitted to the database; 00:02:34 ends up as 0.00178240740740741 in the database.
Is there a different column type that I can use that will leave a string like 00:00:00 unformatted?
That's because excel can't handle the conversion of that data type so what is being reported... the .001782... is the time in days. So if you take 24*60*60* that number you get your 2:34...
When importing to Excel you can append a single quote ' to the beginning of the string value. This kept the formatting in the cell; but it may cause problems with the data later when you have to pull the ' off for processing.
This issue in MySQL for Excel was fixed [at least partially] since version 1.3.0, when you choose to a Create Excel Table on the Advanced Options menu of the Import Dialog. (If you leave that option unchecked the error still appears.)
A bug report with a similar description of the error message you describe has been raised to the MySQL team in charge of MySQL for Excel. If you wanna receive updates on this please feel free to suscribe to Email Updates in this link: http://bugs.mysql.com/bug.php?id=72504