Sort Result Set in Data View by Multiple Columns - datagrip

In prior versions of DataGrip (presumed earlier than 2021.1), result sets within the Data View pane allowed ad-hoc sorting across multiple columns by clicking on column headers in sequence to assign a custom sort order. This functionality is documented in the Data Editor Documentation. Since the release of version 2021.1, clicking multiple columns in sequence resorts the entire result set by the most recently clicked column header only.
Using the following statement as an example yields a result set with 120 date values spanning 4 months, where month_start_date is repeated for calendar_date values that occur within the same month:
SELECT month_start_date
, calendar_date
FROM calendar
WHERE month_start_date BETWEEN '2021-01-01' AND '2021-04-01'
GROUP BY 1, 2
When the month_start_date column header is clicked, the entire result set is sorted based on month_start_date:
When the calendar_date header is subsequently clicked (following clicking the month_start_date column header), the entire result set is re-sorted based only on the values of calendar_date:
Is there a way to sort by multiple columns in version 2021.1, or has this functionality been intentionally removed?

As described in release notes, from 2021.1 accumulating sorting should be performed via Alt/Opt+Click.

Related

Spreadsheet - query-importrange sort by date and keep text in the same column

I am using 3 different spreadsheets which i have linked to a third spreadsheet where it shows up specific columns shorted by date asc (col2). The problem is that in the initial spreadsheets (where i importing the data from) the col30 (which i am trying to sort as col2 in final spreadsheet) has dates and text. What i need is that in the final spreadsheet to have the date sorted and to show also the text (in the col2 of final spreadsheet-which imports data from col30 of the 3 different spreadsheets).
The dates are sorted but neither the text appears nor the rest of the data which are in the same row with the date (on initial spreadsheets). The total data of the columns chosen when "Col6 CONTAINS '"&$B$1&"' are only appears when i put a date on col30 on initial spreadsheets. Otherwise, when it is no date but onlly text on col30 it doesn't return any variables.
Any suggestions? Thank you in advance.
What i have tried so far, which works without showing the text that i need to be shown:
=QUERY(QUERY({IMPORTRANGE("url1 ";"sheet1!A2:AJ1000");IMPORTRANGE("url2 ";"sheet2!A2:AJ1000");IMPORTRANGE("url3 ";"sheet3!A2:AJ1000")};"Select Col5,Col30,Col31,Col21,Col22,Col23,Col24,Col34,Col35,Col36 where Col6 CONTAINS '"&$B$1&"'");"Select * where Col2 is not null order by Col2")
Here is what I believe you are trying to achieve:
=QUERY(
{
IMPORTRANGE("1usAXftvFrpCHz7LN43avWrWqSIO14iKM-pgwuG9jMeE";"Sheet1!A2:AJ")\
ARRAYFORMULA(
TO_TEXT(
IMPORTRANGE("1usAXftvFrpCHz7LN43avWrWqSIO14iKM-pgwuG9jMeE";"Sheet1!AD2:AE")
)
)
};
"SELECT Col5,Col37,Col38,Col21,Col22,Col23,Col24,Col34,Col35,Col36 WHERE Col6='"&$B$1&"' AND Col37 is not null ORDER BY Col30, Col31"
)
Let's unpack the changes:
Remove the outer query. You don't need it. Instead add the condition and order by in the first query.
change the range to be an open ended one
Add columns with the text version of the dates / times.
The last point is important as query only supports a single type at a time. This means that when you were querying over the date and time, you were loosing the text (because they are of another type). Adding 2 more columns and forcing them to be text allows you to add them in the result without loosing information and keeping the originals allows you to order by them.
References
QUERY (Docs editors help)
TO_TEXT (Docs editors help)
ARRAYFORMULA (Docs editors help)

Limiting rows initially returned in select list

Populating an Apex 5.1 select list of employees with about 25,000 names is proving to be a performance problem when loading the page. Is there a method of limiting the initial list to a set number (such as 200), and dynamically populating with chunks of additional names as the user scrolls through the list? Are there other options I should consider that would not slow down the page load?
I am currently using a dynamic LOV, and have tried adjusting this LOV to include Oracle row limiting code; however, there is no way of fetching past the initial set of rows. The source of the data is a view on a materialized view.
I appreciate any ideas
I'd use a pop-up LOV with a search function, not showing any records until the user enters a search value (more than 3 characters). I know it's tedious to use a pop-up LOV but it seems the only way to prevent waiting for a slow list to display.
I'd try with cascading lists of values. I don't know what those 25.000 names represent, but - suppose it is a large company. Then you'd
1st LoV: continent
2nd Lov: country
which refers to the previous LoV as where country.continent = :P1_CONTINENT
3rd LoV: city
which refers the previous LoV as where city.coutry = :P1_COUNTRY
4rd Lov is actually your current query:
which refers to the previous Lov as where person.city = :P1_CITY
Now your list of values wouldn't contain 25.000 rows, but - hopefully - a lot less.

SSRS Static fields in groups

Good afternoon!
I have created a report with the wizard to create a matrix that is grouped and has drill down rows. I have added filters to the rows and columns and it works great! I then copied that matrix and modified the filters, so I had two matrixes.
But what I really wanted was those two rows in the same matrix, just in different row groups. So I added another group, using the adjacent below option, and then added all the child groupings. However, when I run the report it shows the values for the first row of the drill down data.
When I look at the groupings I can see the one I did manually has a 'Static' field in each row grouping but the ones that the wizard did (with the red ?), they don't have that "extra" row:
What do I need to change or how do I need to add my groups so that I don't get that "static" row and not show the data? I have the visibility set to 'Hidden' and the toggle set up for the prior grouping set data.
Assuming a few things....
the data comes from a single dataset
You are differentiating between Property and Violent crimes by filtering on a column, I'll call it IncidentGroup for the sake of illustration..
I've understood your question ! :)
Get to the point where you had just a single tablix filtered to show 'Property crime'.
Now remove or edit that filter so it shows all the data you need in the report.
Finally, right click on your Matrix1_IncidentCategory row and add a parent group, choose IncidentGroup (or whatever the column is actually called) and check the box to add a group header.
That should be it, there is no need for a second tablix.
Without knowing how you are filtering currently it's hard to give a complete answer but this should get you close, if not all the way there.
If this doesn't work for whatever reason, please post sample data from your dataset output and your current filters.

How to sort in filter without using Dynamic Ranking in Endeca?

We are using Endeca to fetch and display records in frontend as a datagrid. In that datagrid, we have 10 columns and we display data sorted in table on the basis of 2 columns (say X and Y). For this, we use Endeca.stratify(collection()/record[not%20(X)])||X|1||*,Endeca.stratify(collection()/record[not%20(Y)])||Y|1.
We can also apply filter on the columns where we display data sorted asc/desc. We used Dynamic Ranking in Endeca and created dimensions for each field with selecting dynamic ranking and set maximum dimension value to return as 20 as per the requirement. Since we know that dynamic ranking is the relevancy ranking, it fetches most used records and does sorting on that data.
However, we need to select 20 unique values and sort them in asc/desc order. Example: if we have date as the column, then we need to fetch 20 unique dates with most recent at the top. i.e. in descending order.
Is there any other way to do sorting on filter apart from dynamic ranking? If we disable dynamic ranking, then we won't have option to set maximum dimension value as 20 from developer studio.
Please suggest for the ranking.
We finally found a solution!! I removed/unchecked "dynamic ranking" for the properties in dimensions from the pipeline using developer studio. I did not want it to remove since we had already selected an option as sort "alphabetically" instead of "dynamically" in dynamic ranking tab in dimensions.
Also, if we uncheck dynamic ranking then the option for giving maximum limit for displaying the dimensions (which was set 20 for us as per the requirement) was also gone.
So, I handled this in java to display only 20 values by putting a check on results obtained and created a counter which would add values only till the 20 are received. Now this is working as required!!!!!

Passing more than 3 items in a reports column link

I have a report that is listing students and I want a column to edit a student. I've done so by following this answer:
How do you add an edit button to each row in a report in Oracle APEX?
However, I can only seem to pass 3 items and there's no option to add more. I took a screenshot to explain more:
I need to pass 8 values, how can I do that?
Thanks!
Normally, for this you would only pass the Primary Key columns (here looks like #RECORD_NUMBER# only). The page that you send the person to would then load the form based on the primary key lookup only. If multiple users were using this application, you would want the edit form to always retrieve the current values of the database, not what happened to be on the screen when a particular person ran a certain report.
Change the Target type to URL.
Apex will format what to already have into a URL text field which magically appears between Tem3 and Page Checksum.
All you need to do is to add your new items and values in the appropriate places in the URL.
I found a workaround, at least it was useful to my scenario.
I have an IR page, query returns 4 columns, lets say: ID, DESCRIPTION, SOME_NUMBER,SOME_NUMBER2.
ID NUMBER(9), DESCRIPTION VARCHAR2(30), SOME_NUMBER NUMBER(1), SOME_NUMBER2 NUMBER(3).
What I did was, to setup items this way:
P11_ITEM1-->#ID#
P11_ITEM2-->#DESCRIPTION#
P11_ITEM3-->#SOME_NUMBER##SOME_NUMBER2#
Previous data have been sent to page 11.
In page 11, all items are display only items.
And P11_ITEM3 actually received two concatenated values.
For example, the calling page has columns SOME_NUMER=4 and SOME_NUMBER2=150
so, in pag1 11, P11_ITEM3 shows 4150
In page 11 I created a Before Footer process (pl/sql expression)
to set up new items, for example P11_N1 as source SUBSTR(P11_ITEM3,1,1)
and item P11_N2 as source SUBSTR(P11_ITEM3,2,3)
So, I had those items with corresponding values from the calling IR page.
The reason I did not pass the primary key only for new lookup access, is because i do not want to stress database performing new queries since all data are already loaded into page items. I've been an oracle DBA for twenty years and I know there is no need to re execute queries if you already have the information somewhere else.
These workarounds are not very useful for a product that bills itself as a RAD tool.
Just include a single quoted word in the select statement (Select col1, 'Randomword', col2 from table 1;)
Then define that column as a link and bingo! More items than 3 to select.

Resources