Select 2nd Element of a Table using Xpath - xpath

How can I select the text field (which is in 2nd column of the table)On binance Top Gainers page
when I search using this query, it will select the first row
(//*[contains(#data-type, 'table-td')])[1]
and same for 2nd row
(//*[contains(#data-type, 'table-td')])[2]
I need to select the 2nd element of this table using xpath (only the text field) (RIF and STX) in this case.
Top Gainers Table on Binance
Or is there a way to get only the text for first and 2nd row
It gave me only the table row.. I need to select the 2nd element of the table.

One way to do this could be :
//div[text()="Top Gainers"]/ancestor::div[2]//div[#class][./img]/div[#title]/#title
or
//div[text()="Top Gainers"]/ancestor::div[2]//div[#class][./img]/div[#title]/text()
Output : 10 items
URL used : https://www.binance.com/en/markets/overview/topmovers

Related

How to add additional column showing sheet names & row source in query importrange function (google sheet)

I have a query importrange function to combine hundreds of my sheet into 1 new googlesheet file, but i need an additional column which show sheet/tab source name and the row source.
this is my query so far :
=QUERY(
{IMPORTRANGE("SheetID-1","Sheet1!A5:Y1000");
IMPORTRANGE("SheetID-2","Sheet2!A5:Y1000");
IMPORTRANGE("SheetID-3","Sheet3!A5:Y1000")},
"SELECT * WHERE Col2 IS NOT NULL Order By Col1", 0)
my query is like that (but for hundreds different sheet) and now i hope i can added aditional column in column Z that showing the source tab/sheet name with row :
Example :
Column Z : Sheet1 - Row 7
If i using filter i can add the additional column with the source row & sheet name like that, but im have no idea to add the column using query. Need some help here.

BIRT allow user to dynamically select report's columns

I want to add an option for the user when creating the report to select the columns that the report will show. See the attached image below on how it is suppose to look.
Is there a way to do that?
I don't know about the parameter dialog, but assuming that your column names are in an array.
You can have an SQL query with all possible column names
(probably you should use special comments to mark the beginning and end of the select list).
E.g.
select
'X' as dummy
-- BEGIN COLS
, column1
, column2
...
-- END COLS
from ...
where ...
order by ...
Then, in the beforeOpen event of the query, you can access and modify the query with this.queryText (IIRC) and remove all those lines ("," + columnname) in the marked part for which columnname is not contained in the array.

How to know the number of results of a Table-Group?

There is a Table in a report , then I inserted a Group within it. Then I added a footer row within the Table. I want to hide this row if the Group has just 1 row result. So how to know the number of results of the Group ?
Select the table -> binding tab -> Add aggregation
Select "count" as function, select any field as expression and set "aggregate on" to the group. Then use this new binding in visibility expression of the footer row.

Update One table Column with Values from Another table Having Similar

Hi Guys I have Two tables (MIGADM.CORPMISCELLANEOUSINFO and CRMUSER.PREFERENCES) and Each Has a field called PREFERENCE_ID and ORGKEY. I want to Update the Preference ID for MIGADM.CORPMISCELLANEOUSINFO with Preference_ID from CRMUSER.PREFERENCES for Each Corresponding ORGKEY. SO I wrote this Query;
update migadm.CORPMISCELLANEOUSINFO s set s.PREFERENCE_ID = (
select e.PREFERENCE_ID from crmuser.preferences e where s.ORGKEY = e.ORGKEY)
But I get:
ORA-01427: single-row subquery returns more than one row
What Should I do?
It means the columns you have selected are not unique enough to identify one row in your source table. Your first step would be to identify those columns.
To see the set of rows that have this problem, run this query.
select e.origkey,
count(*)
from crmuser.preferences e
group by e.origkey
having count(*) > 1
eg : for origkey of 2, let's say there are two rows in the preferences table.
orig_key PREFERENCE_ID
2 202
2 201
Oracle is not sure which of these should be used to update the preference_id column in CORPMISCELLANEOUSINFO
identify the row where the subquery returns more than one row (You could use REJECT ERROR clause to do it for instance) or use the condition 'where rownum = 1'.

How do I fetch n-th row from Cassandra?

I have column family with timestamp as row name and I want to fetch first 10 rows, second 10's, etc.
family = { //CF
TimeUUID: value,
...
I know that I can set column-limit for first query and get first n-th rows, but how can I get next n-th rows?
get_range_slices (use the last key from the previous query as the first key in the next query)

Resources