Rudolf Hinkler
Rudolf Hinkler

Reputation: 21

Google Spreadsheet: Script to pick the right values from data which is html-imported and never in the right order

I have the following problem I can't solve:

There is data of a measuring station for water quality available online (https://hamburg.de/clp/hu/fischerhof/clp1/). It updates every day, but the data is nowhere stored or put into a chart. So my play was to have a script which imports the data automatically. Functions in my spreadsheet would do the rest and put e.g. the water temperature in a chart. So far so good, I found all the scripts and work arounds here.

Then I discovered a problem I can't solve: When the data is uploaded on the website, it is not in the same order. Sometimes water temperature is in the first row, sometimes in the last, sometimes anywhere between. This messes all my data up, as I use a function which filters e.g. every 12-th row, to filter all the water temperature values out and make a chart out of it. When that position changed because of the import, I get wrong values.

Here is my setup so far:

I import the data into Sheet 1 with a script

This script also gathers the data in Sheet 2, where I filter the Water temp values on the right side, the red value shows the problem I mentioned aboth

Have you guys an idea how I can solve this problem? It's my first "project" of this kind, it was really fun until I discovered the problem, but I would really love to make it work!

Upvotes: 2

Views: 64

Answers (1)

Swen
Swen

Reputation: 587

Use this query

=QUERY(A2:C40,"select A, C where B matches 'Wassertemperatur' 
                 label A 'date', C 'Watertemp.'",1)

enter image description here

Upvotes: 2

Related Questions