This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Query and Report Question

Tags: None
(comma "," separated)
User avatar
iwhitfield
Registered Member
Posts
33
Karma
0
OS

Query and Report Question

Wed Jul 27, 2016 9:27 am
Hi All
I'm busy testing Kexi and have run into two problems with Queries and Reporting ...

1) USING MULTIPLE CRITERIA - I'm building a Members Database and each Member has a current 'Status" with the Group, ie 'ACTIVE' 'PENDING', 'UN-FOUND', 'AWOL' etc. I now need to query the Database dependent on their Status. I have found out how to do it with one criteria, (ie List all AWOL Members), but can not find out how to query two or more sub-Groups, (ie List all 'ACTIVE' and 'PENDING' Members).
Is this possible and what is the syntax for the multiple Criteria??

2) NO DATA SOURCE - Once I have the query working I them select to create a Report, (as detailed in the Kexi Handbook). And this I can do - however once I have laid out the Fields I want, I have to link them to a Data Source.
But the Pull-Down box in Properties remains empty no matter what I do.
What am I doing wrong or missing out to get this to work??

Thanks for any help.
User avatar
jstaniek
Moderator
Posts
1027
Karma
2
OS

Re: Query and Report Question

Wed Jul 27, 2016 10:37 am
Thanks for the questions!

1) USING MULTIPLE CRITERIA - I'm building a Members Database and each Member has a current 'Status" with the Group, ie 'ACTIVE' 'PENDING', 'UN-FOUND', 'AWOL' etc. I now need to query the Database dependent on their Status. I have found out how to do it with one criteria, (ie List all AWOL Members), but can not find out how to query two or more sub-Groups, (ie List all 'ACTIVE' and 'PENDING' Members).
Is this possible and what is the syntax for the multiple Criteria??


Could you provide screenshots of your table designs?

2) NO DATA SOURCE - Once I have the query working I them select to create a Report, (as detailed in the Kexi Handbook). And this I can do - however once I have laid out the Fields I want, I have to link them to a Data Source.
But the Pull-Down box in Properties remains empty no matter what I do.
What am I doing wrong or missing out to get this to work??


There may be issues with refreshing the Data Source property. That will be improved in KEXI 3. For now I propose a workaround: save the new report's design, close the report and open it again. The Data Source property should then list field names properly.


Best regards,
Jarosław Staniek
• Qt Certified Specialist
KEXI - Open Source Visual DB Apps Builder
• Request a feature or fix for KEXI here
May I help you? Please mention your app's version and OS when asking for help
User avatar
iwhitfield
Registered Member
Posts
33
Karma
0
OS

Re: Query and Report Question

Wed Jul 27, 2016 2:51 pm
Thanks Jaraslaw

I'm not sure why you need to see my Table Design to work out the multiple criteria question??
But here it is - https://drive.google.com/file/d/0B4QRSiSnDQQjVFVRMVRMaUJQMGs/view?usp=sharing

The Highlighted row, "StatusText" contains the Status of each Member.
The Criteria I use to sort out only one Group, (say 'ACTIVE') is
Code: Select all
='ACTIVE'

What I need is to be able to sort on two or more criteria like
Code: Select all
='ACTIVE' or 'PENDING'


Thanks you for the "work-round" for the Data Source problem. That worked perfectly!! I can now print out my Report!!

PS - You keep talking about the 'NEW' version of Kexi - When is it due out???
User avatar
iwhitfield
Registered Member
Posts
33
Karma
0
OS

Re: Query and Report Question

Sat Aug 13, 2016 11:30 am
No replies I see .... ???

So is this possible????
User avatar
jstaniek
Moderator
Posts
1027
Karma
2
OS

Re: Query and Report Question

Sat Aug 13, 2016 11:37 pm
iwhitfield wrote:Thanks Jaraslaw

I'm not sure why you need to see my Table Design to work out the multiple criteria question??


I needed it to make sure this is not a case of searching in referenced table's field but in "direct" fields. Thanks.

The Highlighted row, "StatusText" contains the Status of each Member.
The Criteria I use to sort out only one Group, (say 'ACTIVE') is
Code: Select all
='ACTIVE'

What I need is to be able to sort on two or more criteria like
Code: Select all
='ACTIVE' or 'PENDING'



You are right about the use of "or". In current Kexi using "or" is not available in the visual query designer. This support is planned later.

To use the "or" we you can switch to the SQL view for the query and locate place such as StatusText = 'ACTIVE' and add the alternative by hand:

StatusText = 'ACTIVE' or StatusText = 'PENDING'

It won't hurt enclosing this expression in parentheses to make sure the logic is right:

(StatusText = 'ACTIVE' or StatusText = 'PENDING')

NOTE: after editing of SQL by adding any constructs that are not supported (recognized) in the visual query designer please do not use the visual query designer for designing this query, only the SQL view.

Also, if this helps: and keyword is designed to work in the visual designer: just add (double click or drag) the StatusText field twice or more and add desired criteria for each of the occurrence. You may want to set the "Visible" flag for these rows to OFF, otherwise the StatusText column will be displayed multiple times in the resulting query.
In Kexi 2 this support in the visual designer is experimental though so "and" should be designed in the SQL view as well (so far). Once completed, for example this will be just working: http://wstaw.org/m/2016/08/14/plasma-desktopDm1694.png.

Hope this helps a bit and also gives a bigger picture.

PS - You keep talking about the 'NEW' version of Kexi - When is it due out???


Within 30 days I hope.


Best regards,
Jarosław Staniek
• Qt Certified Specialist
KEXI - Open Source Visual DB Apps Builder
• Request a feature or fix for KEXI here
May I help you? Please mention your app's version and OS when asking for help


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]