Can you please tell me how to do it?
In Example No.1, you need to add a € sign before the number, and reduce the number of digits after the dot
Should show as: € 1.80
=ARRAY_CONSTRAIN(importXML("https://www.globalpetrolprices.com/Austria/", "//*[#id='graphPageLeft']/table[1]//tr"), 3 ^ 1, 4)
In Example No.2, you need to change the comma to a period and leave the number of zacks after the period
Should show as: € 0.00
https://docs.google.com/spreadsheets/d/1ICQyiU9w-yHPynjJnx2S25Xah0GsFH5yzjATVSuZLVw/edit#gid=496450573
=QUERY(IMPORTXML("https://fuelo.eu/?convertto=eur", "//table[#class=('table table-striped table-hover tablesorter')]//tr"), "Select Col1, Col2, Col6, Col10 label Col1 'Countries', Col2 'Gasoline', Col6 'Diesel', Col10 'AutoGas'")
Example #1, try
=query(ARRAY_CONSTRAIN(importXML("https://www.globalpetrolprices.com/Austria/", "//*[#id='graphPageLeft']/table[1]//tr"), 3, 4),"FORMAT Col3 '€ 0.00', Col4 '€ 0.00'",1)
Example #2
=query(query(QUERY(IMPORTXML("https://fuelo.eu/?convertto=eur", "//table[#class=('table table-striped table-hover tablesorter')]//tr"), "Select Col1, Col2/1000, Col6/1000, Col10/1000 "),"select * format Col2 '€ 0.000',Col3 '€ 0.000',Col4 '€ 0.000' ",1),"label Col1 'Countries', Col2 'Gasoline', Col3 'Diesel', Col4 'AutoGas'",1)
Mike Steelson I took formula and shortened it Query
Now it looks like this:
=QUERY(QUERY(IMPORTXML("https://fuelo.eu/?convertto=eur", "//table[#class=('table table-striped table-hover tablesorter')]//tr"),
"Select Col1, Col2/1000, Col6/1000, Col10/1000
format Col2/1000 '€ 0.00',Col6/1000 '€ 0.00',Col10/1000 '€ 0.00'"),
"Select Col1, Col2, Col3, Col4
label Col1 'Country', Col2 'Gasoline', Col3 'Diesel', Col4 'AutoGas'")
Related
I have added multiTemplateDataRows to my <mat-table multiTemplateDataRows>
and have the following rows:
<mat-header-row *matHeaderRowDef="data.displayedColumns"></mat-header-row>
<tr mat-row *matRowDef="let row; columns: data.displayedColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: ['detail'];"></tr>
but i still receive the error "There can only be one default row without a when predicate function."
I was on a later version of angular material where multiTemplateDataRows was not recognized.
I have a table that shows dates, but some date values are null or blank. I'd like to format them if they exist and display nothing if there's no value.
I was considering something like:
(date != '' ? ${#calendars.format(date,'dd-MM-yyyy HH:mm')} : '')
Is this possible? How?
Maybe you have to try something like this?
<table>
....
<td>
<span th:if="${date != null}"
th:text="${#calendars.format(date,'dd-MM-yyyy HH:mm')}">
</span>
</td>
....
</table>
If you have not null value in date it will shown another it will be blank table cell.
The shortest way I think is this:
<td th:text="${#date} ? ${#calendars.format(date,'dd-MM-yyyy HH:mm')}" />
I created a search application using 2 columns (name and lastname) but is not working when a person has more than 2 names. How can i search a person with 3 names and lastname?
Controller:
class PersonController < ApplicationController
def search
#people = Person.find(:all,:conditions=>["(
name LIKE ? OR
lastname LIKE ? OR
(concat(name, \" \", lastname) LIKE ? )
)" ,
"%#{params[:query]}%",
"%#{params[:query]}%",
"%#{params[:query]}%" ]
)
end
end
View
<% form_tag :controller=>"person",:action=>"search" do %>
Nombre o Apellido
<%= text_field_tag "query", params[:query]
<% end %>
Example
|name| |Lastname|
Marcos Ignacio Raul Perez
I saw on my logs this:
Works if i search Marcos Ignacio Raul Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Marcos Ignacio Raul Perez%' OR
lastname LIKE '%Marcos Ignacio Raul Perez%'
OR (concat(name, " ", lastname) LIKE '%Marcos Ignacio Raul Perez%' )
))
Works if i search Ignacio Raul Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Ignacio Raul Perez%' OR
lastname LIKE '%Ignacio Raul Perez%'
OR (concat(name, " ", lastname) LIKE 'Ignacio Raul Perez%' )
))
Works if i search Raul Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Raul Perez%' OR
lastname LIKE '%Raul Perez%'
OR (concat(name, " ", lastname) LIKE 'Perez%' )
))
Doesn't work if i search Marcos Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Marcos Perez%' OR
lastname LIKE '%Marcos Perez%'
OR (concat(name, " ", lastname) LIKE '%Marcos Perez%' )
))
Doesn't work if i search Ignacio Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Ignacio Perez%' OR
lastname LIKE '%Marcos Perez%'
OR (concat(name, " ", lastname) LIKE '%Ignacio Perez%' )
))
Doesn't work if i search Marcos Raul Perez
SELECT * FROM `people`
WHERE ((
name LIKE '%Marcos Raul Perez%' OR
lastname LIKE '%Marcos Raul Perez%'
OR (concat(name, " ", lastname) LIKE '%Marcos Raul Perez%' )
))
I will really appreciate help.
I highly recommend using elasticsearch with tire gem or something similar instead of SQL. It looks like your search requirements are complex. Problem that you are having with search in SQL is a sign of missing capabilities in underlying application architecture.
You can use Thinking sphinx is a good gem for rails search
I have a select tag like so:
= select_tag :cc, options_from_collection_for_select(#possible_contacts, "id", "email")
this lists each of #possible_contacts email addresses. each contact also has a name. what I would like to do is display each #possible_contacts as a name and email address like so:
Joe Smith <joe#gmail.com>
this requires both email and name...but I'm not sure how to put both of them in the select
You could use options_for_select instead, something like:
select_tag :cc, options_for_select(#possible_contacts.map{|contact| ["#{contact.name} <#{contact.email}>", contact.id])
For example, this is basically the same as:
select_tag :cc, options_for_select([['Joe Smith <joe#example.com>', 123], ['David H Hansson <dhh#example.com>', 987]])
which turns into:
<select id="cc" name="cc">
<option value="123">Joe Smith <joe#example.com></option>
<option value="987">David H Hansson <dhh#example.com></option>
</select>
Under the new HighCharts 3.0 - they included a data module plugin (example here). The actual script is here
I have a table like
<table id="data-table">
<thead>
<tr>
<th>Date</th>
<th>Name</th>
<th>Address</th>
<th>Business</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>1/01/2013</td>
<td>John Apple</td>
<td>51 Blah Street, CA</td>
<td>Yes</td>
<td>$54.33</td>
</tr>
</tbody>
</table>
I am trying to figure out how I can map the date, and price in the new format ? So that the price is Y and the date is X and the series is Y,X
Currently, the example only shows how to map the entire table - but I only want to map 2 columns ?
data module is taking or whole table, or you can specify :
* - endColumn : Integer
* In tabular input data, the first row (indexed by 0) to use. Defaults to the last column containing data.
*
* - endRow : Integer
* In tabular input data, the last row (indexed by 0) to use. Defaults to the last row containing data.
There is no option to specify only some of columns/rows.