Group or sort values in calc (libre office) - libreoffice

Sorry for non-programmatic question - I need a help with libre office tools.
I have (for example) such table, where the first column is an IP addresses
A B C
2.3.4.5 bbb 22c
1.2.1.4 aaa 11v
4.2.3.5 ccc 33v
1.2.1.4 ddd 55c
And I need to group (or sort) them - to compare a data from the same IP, so the result must be something like this:
A B C
1.2.1.4 aaa 11v
1.2.1.4 ddd 55c
2.3.4.5 bbb 22c
4.2.3.5 ccc 33v
how could it be done ?

Data -> Sort
Then specify the keys (in your case, simply Column A, Ascending)
#see https://help.libreoffice.org/Calc/Sorting_Data

Related

How do I get the first object, from each group of objects in core data

This is my sample data table which is called "Conversations":
ID
ConsumerID
CreationDate
1
aaa
23/8/2000
2
aaa
21/8/2000
3
aaa
10/7/2000
4
bbb
30/8/2000
5
bbb
1/7/2000
6
bbb
22/7/2000
I'm using NSFetchRequest to get the newest conversation, for each consumerID, but I can't find anything similar online.
This is my expected response:
ID
ConsumerID
CreationDate
1
aaa
23/8/2000
4
bbb
30/8/2000
Actually i'm trying to get the conversations objects that match that criteria. The creation date could not have duplications so there is no need to handle such cases.
Can anyone help me with that please?

Using DIFFERENCE in a WHERE clause

I want to use the DIFFERENCE keyword in a T-SQL query to find data that is equal or very similar between two data sets. DIFFERENCE returns a score from 1-4, where 4 is very similar and 1 is not similar at all.
For example, if I have two data sets, A and B, that contain the following:
A B
---- ----
adam adam
bob billy
charlie brittany
doug charles
frances diana
heather
kim
I would want to select ones that are equal or similar (say, DIFFERENCE value of 3 or 4), so I would want the result set (which stems from data set A) of:
Result
----
adam
charlie
My thought is to put the DIFFERENCE keyword in the WHERE clause, something like this:
SELECT *
FROM A
/* somehow join B here, despite that A and B might not be exact matches such as in charlie and charles */
WHERE DIFFERENCE(A, B) >= 3
How can I do this?
select *
from a
join b
on difference(a.name, b.name) = 4;

Make 2 lines appear as table

I have a list like this
Id Number
Name
i.e.,
101g
aaa
102g
bbb
103g
ccc
etc.,
I need them to appear in single line
Id Number Name
101g aaa
102g bbb
103g ccc
How to do this?
Can anyone help pls?
In Excel, assuming your data is in column A, enter the following formula in any other column
=INDEX($A:$A,(ROW(1:1))*2-1)
In the column next to this, enter the following,
=INDEX($A:$A,(ROW(1:1))*2)
Now copy both of these down.

Sub report links in crystal reports

I have a report having a command object where I have empno and some columns. And I have another command object which also having empno.
For 1st command the parameter is division and based on division I will get some empnos in 1st commnd object and I need to pass this empnos from 1st command object to 2nd command object.
So that the 2nd command object should get some empnos from 1st command object and should display countries based on the matched empnos .
So I linked both command objects empnos in links tab.
Due to some performance issue I am doing like this
Created a sub report with 2nd command object and created empno parameter. Now in sub reports links tab I am passing main reports empno to sub reports empno parameter.
But I am getting non matching empnos data.
Please suggest
Here what I observed in my 1st table have data like this.
eno name division
1 aaa 2
2 bbb 2
3 ccc 2
In my 2nd table I have data like this
eno country division
1 India 2
2 Aus 2
By using 1st method(linking command objects in links tab).
I am getting result like this.
eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
By using 1st method(Sub report approach).
I am getting result like this.
eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
3 ccc 2
I need to get only employees present in both tables using sub report approach.
Please suggest
Hi Siva i am unable to post the image I am getting data like this.In my 2nd table I have onlt enos 1 and 2 .But I am getting all the emps even I used record selection formula also
**eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
3 ccc 2**
when you use sub report for this purpose then you should not link parameters of main report to sub report instead you should use the linked parameter in Record Selection Formula of sub report then your filtering applies to sub report.
for e.g:
pass the parameter to sub report through links (Take care dont link the parameters) then you will get siomething like this {pm-parameter1}.
then go to record selectoin formula and write as
database field = {pm-parameter1}

Crystal Reports grouping two tables based on the primary key of one table

I have 2 tables:
Product
fields are: prod_no (primary key), prod_name
Sales
fields are: sal_no, sal_date, cust, prod1 (foreign key i.e. prod_no), prod2 (foreign key i.e. prod_no), fst_qty, snd_qty
I want to sort my report based on prod_no.
Example:
Product
prod_no prod_name
1. printer
2. paper
3. cartridge
Sales
sal_no sal_date customer prod1 prod2 fst_qty snd_qty
1 5-sep-09 aaa 1 3 2 3
2 5-sep-09 bbb 2 3 1 1
3 5-sep-09 ccc 1 2 3 4
I want a report like this:
prod_no
1
sal_no sal_date customer qty
1 5-sep-09 aaa 2
3 5-sep-09 ccc 3
2
2 5-sep-09 bbb 1
3 5-sep-09 ccc 4
3
1 5-sep-09 aaa 3
2 5-sep-09 bbb 1
Book - Crystal reports 10: the complete reference By George Peck
Looks like a job for subreports to me, with Prod_No passed as a parameter.
You need to work on your grouping skills for this. I believe that if you simply create groupings for prod_no and then sal_no, and after placing the necessary fields in the proper group headers and details sections you should be able to display this info in the way that you want it.
Please see my answer on the below question for an example of a grouping similar to what you are looking for.
How to avoid the duplicate values?
Hope this helps and don't forget to mark an answer as the accepted answer and vote for answers that have helped. Thanks