BigQuery view integer column read as Json when imported in PowerBI - json

I have created this view in BigQuery:
create view project.dataset.view1 as
SELECT
o.first
,o.id as theid
,p.id as otherid
FROM dataset.view2 as o
JOIN dataset.view3 as p on p.whatever = o.id
When i add the data in that view to PowerBi, the column p.id it shows as Json string with all the three columns, while it should be only an integer.
This is an example of what i see:
{""v"":{""f"":[{""v"":""name""},{""v"":""11""},{""v"":""9""}]}}
In BigQuery it just looks fine with the integer value I'm expecting.
Can somebody shed some light on this? It's driving me nuts. Thanks.

Ok, i don't know how much of a bug vs my fault this is. i have named the 3rd column just like the view.
Not sure here if it's a good thing to do, but again, Google Data Studio and KlipFolio didn't give me that result.
Changing the column name fixed it though in PowerBI.

Related

Can Access queries match one value in a table with the field name in the other table?

CPC is a kind of measurement, we ran different CPCs in every day and get second data. So I have a long list of CPC files and one location file. In here, I only use CPC1 in 4/27/2017 as an example (the following first jpg). Location file has the longitude and latitude of CPCs everyday of the entire experiment (the second example table in the following jpg).
Because the location only has date, ID, and long/lat, I want to link ID (CPC name) column in location file to file name (also CPC name) of every CPC files.
I am not sure how it can be done, but I guess it should be done in SQL or VBA. I hope there is a simpler way. Although I only know VBA in Excel, but if it has to be done in SQL or VBA, please get me some ideas. Thank you so much.
Example of CPC1
Example of location file
Perhaps this query will accomplish:
SELECT location.*, CPC1.* FROM CPC1 INNER JOIN CPC1.Date ON location.date WHERE location.ID = "CPC1";
Assumes same dates are in both tables, hence the INNER JOIN.

Result set must be in groupings - MYSQL

I am making a report using java code and it is working fine (Image Right).
Now I want to convert it to BIRT.
Since BIRT focuses on Query, I have to change my java code to plain query. Problem is, I have a for each loop on java query where mysql doesn't have.
I found similar query in here but it did not work on me.
As of now, using plain query this is my result:
BIRT RESULT
What am I missing in here? Here's my code.
SELECT item.No_, item.Description, item_ledger_entry.Item_No_,
item_ledger_entry.Description,item_ledger_entry.Posting_Date,
item_ledger_entry.External_Document_No_, item_ledger_entry.Document_No_,
item_ledger_entry.Location_Code, item_ledger_entry.Quantity,
item_ledger_entry.Entry_Type
FROM pbsdev3.item, pbsdev3.item_ledger_entry
where item.No_ = item_ledger_entry.Item_No_
and item.Description = item_ledger_entry.Description
group by item.No_;
I am a very fresh coder so I don't have much knowledge yet.
The result I wanted Look like this(It must be this)
This is the item Table and the item_ledger_entry
Help much appreciated!
Actually, your query is good working good. Make sure you are using Table instead of grid. Table is better than grid when it comes to multiple data.
And by the way, you don't need that groupings.

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

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.

Crystal Report Self Joins

I'm trying to put a report together using Crystal Reports. I have to display a list of "class numbers" and the description of those classes. If there are prerequisites for those classes, I need to list those (the class number) as well as a description/title.
Currently I am able to display everything but the prerequisite descriptions. I believe I have to preform a self join since I'm only using one table. What I've done so far is use the command option when entering the tables I want to use for the report. In that command I have
SELECT Main.prerequisite, Sub.course_no, Sub.description
FROM course Main
JOIN course Sub ON Main.prerequisite = Sub.course_no
where main.prerequisite is not null
The table is called "course" while the columns are "course_no", "description", "prerequisite".
Anytime I add "description" to the report, it only gives me the course_no's corresponding description, not the prerequisite description.
I'm not sure what I'm doing wrong or what I'm not doing at all, but any help would be greatly appreciated. Thank you.
I figured a work around and thought I should post it here. Hopefully to avoid wasting anyone's time as well as providing my solution to anyone that may have a similar issue.
I simply created a view in SQL
Create view preReqs AS
SELECT Main.course_no AS [course_no]
,Main.description AS [description]
,Main.prerequisite AS [prerequisite]
,Sub.description AS [preReqDescription]
FROM course As Main
LEFT OUTER JOIN course As Sub ON Main.prerequisite = Sub.course_no
After I created that, I just imported the view instead of the table itself into the Crystal Report. I was then able to group by whatever I wished.
Hopefully this will help anyone else that may run into this issue. Thank you for everyone that provided their time/input as well. I appreciate it.

Trouble in search in Grocery CRUD library

While using search query through Grocery CRUD library in Codeigniter,search for "0" value of a data in a table results in the full table. why?
$crud = new grocery_CRUD();
$crud->set_table('listing');
$crud->field_type('SwimmingPool','dropdown',array('1'=>'Yes', '0'=>'No'));
$output = $crud->render();
Now searching in output of grocery_CRUD for the values of SwimmingPool = 0, results in the complete table (all values). While it works fine for SwimmingPool =1 and filter the results properly. I double checked the MySQL database table 'listing' and SwimmingPool has value 0 or 1 only. is this some kind of bug that search query results in the complete table if searched for 0. Any Solution?
This is likely a bug of grocery crud, interpreting 0 as null so it does not apply the search filter. I suggest filling a bug report at Grocery's bug tracker on github