Set value of combo box in AppleScript not saving - applescript

I am setting a value of a Combo Box using AppleScript. I can see the value is over there, but when I leave the table row, it does not store the value.
This is how I am setting it:
set value of combo box 1 of scroll area 1 of group 2 of splitter group 1 of splitter group 1 of group 1 of window 1 to str
On the application I can see it was correctly set, but if I leave the row, it is not stored. This commando is inside a table loop:
repeat with aRow in rows of table 1 of scroll area 1 of group 1 of group 1 of splitter group 1 of splitter group 1 of group 1 of window 1
select aRow
set value of combo box 1 of scroll area 1 of group 2 of splitter group 1 of splitter group 1 of group 1 of window 1 to str
end repeat
Using the Element Inspector, I can see there is an action called Confirm on this combobox, maybe I need to call it? If so, how can I do it?

Related

query group by with having and get results in two different columns

I have a table like these:
Name Source ended_status date Environment
House DC 1 2019/10/03 Pro
Cat DC2 1 2019/10/05 Pro
Pen DC 1 2019/10/03 Pro
Pen DC 0 2019/11/07 Pre
I would like to get:
Source Environment Ended_Status_with_1 Ended_Status_with_2
DC Pro 2 0
DC Pre 1 0
DC2 Pro 1 0
So, they must be grouped by Source,Environment and I must calculate a summation of all that they have Ended_Status with 1 and all with ended status 2 and put in the same line.
How could I do that?
I can make query grouped by every ended_status but I can't put the two summations of ended status in same line.
Many thanks and sorry for my poor English!
also, try below query
select source,environment,sum(decode(ended_status,1,1,0)) ended_status_with_1,
sum(decode(ended_status,2,1,0)) ended_status_with_2 from mytable
group by source,environment
You can use conditional aggregation:
select
source,
environment,
sum(case when ended_status = 1 then 1 else 0 end) ended_status_with_1,
sum(case when ended_status = 2 then 1 else 0 end) ended_status_with_2
from mytable
group by
source,
environment

Insert empty row which shows total when Item number get change

In my report, there is a table which shows Item number, Employee name, and Hours.
Item Number Employee Hrs
1 ABC 2
1 DEF 1
2 ABC 3
2 XYZ 4
I want to show one empty row below as a separator when Item number get change. In that row want to show the total number of hours. Like below.
Item Number Employee Hrs
1 ABC 2
1 DEF 1
Total 3
2 ABC 3
2 XYZ 4
Total 7
Thanks, Bhushan the link was helpful. Link: https://learn.microsoft.com/en-us/sql/reporting-services/lesson-6-adding-grouping-and-totals-reporting-services?view=sql-server-2017.
I changed the report design by adding grouping. Also showing sum after each group.

Oracle Apex - Change SQL Query when button is pressed

Is it possible to change the date range (between date1 and date2) of a query using a button? Basically I have one Card that shows the total sales depending on which of these buttons, Today, This Week, This Month is selected. I'd like to use ONLY 1 card to display the result. Not the dirty way of hiding the other cards.
This applies to Oracle Apex 5.x
Thanks.
You could create two hidden items (suppose it is page 1), P1_DATE_FROM and P1_DATE_TO and set their values by pressing those buttons (for example, via a dynamic action, using "Set Value").
Then the query would be
where date_column between :P1_DATE_FROM and :P1_DATE_TO
Alternatively, if you switch from 3 buttons to a radio button group with 3 radio buttons (whose values are 1 = today, 2 = this week, 3 = this month), then you could rewrite it as
where date_column between
case when :P1_RADIO = 1 then trunc(sysdate)
when :P1_RADIO = 2 then trunc(sysdate) - 7
when :P1_RADIO = 3 then trunc(sysdate, 'mm')
end
--
and
--
case when :P1_RADIO = 1 then trunc(sysdate) + 1
when :P1_RADIO = 2 then trunc(sysdate) + 1
when :P1_RADIO = 3 then add_months(trunc(sysdate, 'mm'), 1)
end
Those values might need to be changed, depending on what your DATE_COLUMN really contains, and what would "today" or "this week" or "this month" really be.
Okay so I tried this with a select list instead of a radio button group. This is now my current query
TRUNC(SS.EODATE) BETWEEN
(CASE
WHEN :P1_CO_SELECT_LIST = 1 THEN TRUNC(SYSDATE) -1
WHEN :P1_CO_SELECT_LIST = 2 THEN TRUNC(SYSDATE) -8
WHEN :P1_CO_SELECT_LIST = 3 THEN TRUNC(SYSDATE, 'MM')
WHEN :P1_CO_SELECT_LIST = 4 THEN TRUNC(SYSDATE, 'YY')
END)
AND SYSDATE
And this is what my what select list static values
STATIC:Yesterday;1,This Week;2,This Month;3,This Year;4
I am getting correct values when trying each line and not using a case statement so I guess the modification I did from your comment is working.
My problem is refreshing my Classic Report (Card template) without refreshing the whole page. I created a Dynamic Action on the Change event of the select list, then added a Refresh action with below settings...
Action: Refresh
Selection Type: Region
Region: My Report Region
I have set my Select List a Default value = 3 which works. My report queries the This Month date.
Now, when I try to change my selection in the select list, the report region changes data but not the expected data I need. And when I try to change again, it reloads the report region but the values doesn't change.
I'm sure I'm missing something here.

Using oracle loop to concatanete strings

I have someting like this
id day descrition
1 1 hi
1 1 today
1 1 is a beautifull
1 1 day
1 2 exemplo
1 2 for
1 2 this case
I need to do a funtion that for each day concatenate the descrtiomn colunm and return the result like this
id day descrition
1 1 hi today is a beautifull thay
1 2 exemplo for this case
Anny ideia about how can i do this usisng a loop in a function in oracle
You need a way of determining which order the values should be aggregated. The snippet below will rely on the implicit order in which Oracle reads the rows from the datafiles - if you have row movement enabled then you may get inconsistent results as the rows can be read in different orders as they are relocated in the underlying datafiles.
SELECT LISTAGG( description, ' ' ) WITHIN GROUP ( ORDER BY ROWNUM ) AS description
FROM your_table
GROUP BY id, day
It would be better to have another column that stores the order within each day.

How to select a row in a table and select a specific radio button next to it

I would like to select a specific row in a table on a website and select a button next to it. The problem I have is each time I select the button it remembers the last button by position xpath=(//a[#id='DeleteLnkBtn'])[4] but i would like to select the row by name and select the button unique to that row. There are multiple rows with the same buttons all having the same name (Delete).
HTML:
<td>Auto Missed Session 2</td> <a id="DeleteLnkBtn" >Delete</a>
My aim is to reference the row by a text in the table "Auto Missed Session 2" and click on the delete button.
Here is what I've tried so far.
Option 1 - driver.findElement(By.xpath("//tr/td[contains(text() = 'Auto Missed ssion 2', + 'DeleteLnkBtn')]")).click();
Option 2 - driver.findElement(By.xpath("(//tr/td[contains(text(),'Auto Missed Session 2' + 'Delete')])")).click();
The above fails stating this is not a valid Xpath expresssion on Option 1 and No such element: unable to locate element on Option 2
The table data looks like this
td> Auto Missed Session 2 /td> - This is the name of the row in the table i would like to select.
a id= "DeleteLnkBtn" This is the button i would like to select.
Xpath of the button is //*[#id="DeleteLnkBtn"]
Thanks.
Try below code and let me know the result:
driver.findElement(By.xpath("//td[text() = 'Auto Missed Session 2']/following::a[text()='Delete']")).click();

Resources