pre-filtering

Status
Not open for further replies.

Vadim

Member
I tried to describe a task for pre-filtering of 3 views of the list in attached file like flowchart. Hope for help!
 

Attachments

  • prefiltering.jpg
    prefiltering.jpg
    91.1 KB · Views: 407
Hmmmm.

Can't really do that using the built-in pre-filtering grouping logic, as it doesn't fit in to the usual AND/OR where clause grouping.

You'll probably need to come up with a stand alone query, probably using a CASE conditional structure, which returns the 'id' (PK value) of the rows you need, and use that as a 'query' type in a single pre-filter like ...

WHERE
Field: id
Condition: IN
Value: your query which returns a result set of id's
Type: Query

Or ... you could use the pre-query method, running a pre-query to build your 'id' result set as a field using GROUP_CONCAT and use the {$q->field} placeholder in your pre-filter.

There's plenty of tutorials and help out there on the 'net on how to write conditional queries using CASE or IF statements.

So the first step is to work out a single query which will return your desired result set. I'll try and help, but conditionals in MySQL are not something I have that much experience with, so I'm having to google around for examples.

-- hugh
 
It'll be great if you'll try and help! - sorry to say but I understand not very much from your comments, just that you catch the idea and has a plan how to solve it. As for me I'm sure that I cannot realize it by myself.
So' I'm waiting when you come back with something readiness to copypaste or similar simple actions for me. Thank you in advance!
 
Hi

can you provide a sample sql dump of the database table you are working with and the names of the fields that refer to the diagram you posted in your first post?

That should get us started in being able to advise on the setup

thx
Rob
 
List name - ????? ??????, Db table - fab_zayavka.
Legends for elements to the posted diagram:
Column 1 - id zayavka_date, name - ???? ????????? ????? ???????
Column 2 - id zayavka_status, name - ?????? ??????, given value - ???????????
Column 3 - id zayavka_indentification_user, name - ??? ???????? ????????????? ????????????? ???????? ??????????
Column 4 - id zayavka_indentification_problem, name - ??? ???????? ????????????? ????????????? ?????????? ?????????
Column 5 - id zayavka_admin_fund, name - ??? ???????????????

It's all, if you need smth else just let me know please
 
I'm doing some research on conditional queries in MySQL. As I said earlier, this isn't something I'm very familiar with. So this may take a while, as I have to learn how to do it, set up a test case, and try various options out.

This isn't a standard feature of Fabrik, and is really pushing the envelope in terms of customizing pre-filter queries.

But I shall do my best to help.

-- hugh
 
Rob, thank you for your support yesterday! I've checked today - there are some serious bugs, please check skype for details
 
hi
I took a look at the site.

Your prefilter was set up ok, but there is an issue with using cyrilic strings as values.
Your prefilter was saying:

Code:
where `zayavka_admin_agree` =  '???????????'

but we are storing data as uft8 so your test record had a value for `zayavka_admin_agree` of:
Code:
\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u044e

What I have done is to change `zayavka_admin_agree` so that its value is '1' (you can keep the label as cyrilic text that is not a problem)

and changed the pre-filter to be

Code:
where `zayavka_admin_agree` =  '1'

which now shows your test record as expected here:

http://www.dobrochyn.org/index.php/features/philanthropy-marketplace

So for now I would suggest that any checkbox, radio button etc should have numeric values to avoid further issue with prefilters.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top