So I'm currently working on some powerBI stuff, and I have a database table which is hierarchic, meaning I have something like this:
__id___Place______id_parent
London_____null
Paris________null
Madrid_____null
MyInc_________1
Building1_____4
Building2_____4
Floor1________5
Floor2________5
And i'd like to display it like so:
London
MyInc
Building1
Floor1
Floor2
Building2
Paris
Madrid
Of course I have way more data, and some sub divisions everywhere
Any idea how I can achieve that?
Thanks by advance for your support
Related
I'm creating a body-wax comparison website for my own project with cakephp4 and I'm stuck with a problem right now and I dunno what to do.
Situation:
There are multiple body-waxing companies, each company has many options for waxing like legs, arms,
beard etc. And each company has different price range for each waxing part.
CompanyA->arms = $60
CompanyA->legs = $30
CompanyB->arms = $50
I already connected to the Companies-table and Parts-table like the image below. Additionally, I came up with the idea of Prices-table too but I'm not sure if it's doable or I need to come up with something else.
Hopefully, I want to edit the price in the companies edit/add pages.
Any help I would appreciate.
I want to show the results of a MySQL query on my website using angularjs. For now, I'm showing them using a simple table with ng-repeat and it works with no problem. But because the data is a lot, I wanted to ask if it is possible to create multiple panels or tables per specific field.
To be more specific, I have 4 fields returned from the query: name, address, occupation, department. Right now I have a table such as:
George Smith Nikis 10 Project Manager Finance
Maria Bexley Lincoln 20 Project Manager Research
Chris Liggs Forks 123 Programmer Computer Science
etc. I want to know if I can create as many panels or tables as the unique values of the "occupation" field are and then show the results per that unique value inside each panel/table. So instead of the above table I would have something like:
Project Manager
George Smith Nikis 10 Finance
Maria Bexley Lincoln 20 Research
Programmer
Chris Liggs Forks 123 Computer Science
I think you need to use groupby filter
Check this fiddle by Darryl Rubarth, it contains the answer you need
http://jsfiddle.net/drubarth/R8YZh/
<div ng-repeat="item in MyList | orderBy:'groupfield' | groupBy:'groupfield'" >
You can use group by filter in ng-repeat with which you need to group
My table in SQL server has some entries like shown below.
2934046 Kellogg’s Share Your Breakfast 74672 2407522 Kellogg?s Share Your Breakfast ACTIVE 2015-09-01 9999-12-31
2934046 Kellogg?s Share Your Breakfast 74672 2407522 Kellogg?s Share Your Breakfast ACTIVE 2015-09-01 9999-12-31
Another example could be
2939508 UOL Ação Social 81534 1527484 UOL Ac?o Social ACTIVE 2015-09-01 9999-12-31
2939508 UOL Ac?o Social 81534 1527484 UOL Ac?o Social ACTIVE 2015-09-01 9999-12-31
As it can be seen that both the entries are same, except for the question mark character in the second entry. Even if I do something like
SELECT DISTINCT * from my_table
it is not useful. I have to figure out a way to remove such kinds of duplicate entries based on special characters. My manager says that the entries with question marks are basically bad data and I should remove them. Does anyone have an idea how to do so ?
You can implement damerau-levenshtein algorithm which evaluates how similar two strings are in a clr project and utilize it for t-sql.
You can experiment with your data to find the proper threshold value in order to accept two strings as duplicates.
A c# example of algorithm implementation can be found here:
Damerau - Levenshtein Distance, adding a threshold
I have face the same problem this year during data load activity but my manager provide me hint to use SSIS fuzzy grouping transformation to find identical records. Please create small SSIS package , add data flow task. Inside data flow task add (source + fuzzy grouping + destination).
Visit -
Adding Fuzzy Group Transform to Identify Duplicates
https://msdn.microsoft.com/en-us/library/jj819770(v=sql.120).aspx
Ok. Just a scenario.
I got about 100 smart homes. Every smart home has a different amount of door sensors, temperature sensors, humidity sensors. Every house could add or remove some of them.
For this example every temp & hum sensor uploads every 10 minutes (asynchron) their current value (via MQTT) to a server (144 Values/per day/per sensor). And all door sensors upload their state (open, closed) everytime the state changes.
In my study I just got a little insight in relational database (MySQL) and I think that is the wrong model for my purpose (but I have nearly forget everything). So could you just give me tip like:
"Search for "relational Database". "MySQL". This works fine for your case because..."
I want a database where i could add a smart home: with informations like city, street, inhabitant,.... And to this smart home I add sensors like (temp1, temp2, temp3, temp4, door1, door2, hum1). Important: I want to be able to add and remove sensors.
and for every Sensor I want the data stored like this:
temp1
Date Temperature
01.01.2016 09:42 22.2°C
01.01.2016 09:52 21.2°C
01.01.2016 10:02 21.5°C
01.01.2016 10:42 21.7°C
01.01.2016 10:42 21.9°C
01.01.2016 10:42 21.8°C
01.01.2016 10:42 22.1°C
is this a object-orient-database?
Would it be possible to get the History of the last seven days from smarthome45.door7
greetings from germany
Edit:
"Unclear. What is your question ? Please edit." – kebs
I don't have much experience in databases. I read some summarys of the different database models but I still don't know, which of them would fit for my project. So I just hoped, that someone who has some experience in databases could give me some advices. Because for me it looks like I have a database in a database.
Depending on your question any relational database (XXX SQL) would work. You must design database to handle your time based data.
I need to scrape Form 10-K reports (i.e. annual reports of US companies) from SEC website for a project.
The trouble is, companies do not use the exact same format for filing this data. So for ex., real estate data for 2 different companies could be displayed as below
1st company
Property name State City Ownership Year Occupancy Total Area
------------- ----- ------ --------- ---- --------- ----------
ABC Mall TX Dallas Fee 2007 97% 1,347,377
XYZ Plaza CA Ontario Fee 2008 85% 2,252,117
2nd company
Property % Ownership %Occupany Rent Square Feet
--------------- ----------- --------- ----- -----------
New York City
ABC Plaza 100.0% 89.0% 38.07 2,249,000
123 Stores 100.0% 50.0% 18.00 1,547,000
Washington DC Office
12th street .......
2001, J Drive .......
etc.
Likewise, the data layout could be entirely different for other companies.
I would like to know if there are better ways to scrape this type of heterogenous data other than writing complex regex searches.
I have the liberty to use Java, Perl, Python or Groovy for this work.
I'd be inclined to keep a library of meta files that describe the layout for each page you want to scrape data from and use it when trying to get the data.
In that way you don't need complex reg-ex commands and if a site changes its design you simply change a single one of your files.
How you decide to create the meta file is up to you but things like pertinent class names or tags might be a good start.
then describe how to extract the data from that tag.
Unsure if there is a tool out there that does all that.
The other, nicer, way might be to contact the owners of these sites and see if they provide a feed in the form of a WebService or something that you can use to get the data. Saves a lot of heartache I should think.