filter option... help

filter option... help

by David Delcò -
Number of replies: 4

Goodmorning everyone,

I'm new to this forum and I'm slowly learning to use the "Configurable Reports" block by trying.

I apologize if I post a request already processed, but through a little research on the forum I have not found the topics I'm looking for.

I prepared a report (I put everything below) and then I added a filter to show me only the data of a specific course, but when I select the course in question, something happens because the screen changes for a moment (very quickly), but then return to the first screen with all the courses ...


Can anyone help me ... using simple words even better ...


Thank you. Hello everybody.

David

-.-.-.-.-

My SQL report:

SELECT

CONCAT(u.lastname , ' ' , u.firstname) AS 'User',

c.fullname AS 'Course',

DATE_FORMAT(FROM_UNIXTIME(p.timecompleted),'%d.%m.%Y') 

AS completed

FROM prefix_course_completions AS p

JOIN prefix_course AS c ON p.course = c.id

JOIN prefix_user AS u ON p.userid = u.id

WHERE c.enablecompletion = 1

ORDER BY 'Nome'



Average of ratings: -
In reply to David Delcò

Re: filter option... help

by David Saylor -

You need to add the filter to your SQL. For the courses filter it would look like this:

%%FILTER_COURSES:c.id%%
If you add it after your WHERE statement before your ORDER BY that should do it.
Average of ratings: Useful (1)
In reply to David Saylor

Ri: Re: filter option... help

by David Delcò -

Hi David.

It does run very well!

Thank you very much for your help... it was very simple & clear smile

Bye.

DD

In reply to David Saylor

Ri: Re: filter option... help

by David Delcò -

David,

I try to ask you one more question.

If I would now filter by a field containing  "last name and the first name" of the users, (for example: Delcò David), how can I proceed?

I saw the possibility by user.id or by last name or first name only or by student name, but it is listed in the "reverse" format "first name" and "last name"(David Delcò)....

Thank for your evilfurther help and greeting from Switzerland.

DD


In reply to David Delcò

Re: Ri: Re: filter option... help

by David Saylor -

Hey David,

I don't know that there is a way in the standard plugin to do what you're asking. However, if you're ok with a text field instead of a dropdown, you could search against the users by adding a "search text" filter and then adding the following to your report below the last filter entry:

%%FILTER_SEARCHTEXT:CONCAT(u.firstname, ' ', u.lastname):~%%

Average of ratings: Useful (2)