Hi Ramya,

Thanks for your invaluable help, it worked with no problems.

I made a query like the one below and i could retrieve with no further
problems, info of question groups related to a long.


SELECT customer.display_name as 'Name' ,
question_group_response.response as 'Debit Account Number'
FROM   customer,account,loan_account,question_group,
question_group_instance,question_group_response,
       questions, sections, sections_questions
WHERE
questions.question_text  = "Account number"
AND sections.name = "Debit Order Authorization"
AND questions.question_id = sections_questions.question_id
AND sections.question_group_id = question_group.id
AND question_group.title = "Debit Order Authorization"
AND question_group.id  = question_group_instance.question_group_id
AND question_group_response.question_group_instance_id =
question_group_instance.id
AND sections_questions.id = sections_questions_id
AND loan_account.account_id = question_group_instance.entity_id
AND account.account_id = loan_account.account_id
AND customer.customer_id = account.customer_id; 


Cheers,
Natu

On Sun, May 8, 2011 at 9:52 PM,  <ramya.toshni...@sungard.com> wrote:
> Hi Natu,
>
> The way Mifos schema has been designed, we divide it into various
> entities like center, group, client, loan, savings  etc. But to capture
> custom fields against each of these entities, the database tables are
> same. So, in order to find out the custom field against a specific
> entity instance, there is a field entity_id in the
> question_group_instance table. This entity_id can serve the role of
> either center_id, group_id, client_id or account_id at a time. In order
> to find what id it is (among these), please consider the foreign key
> field event_source_id in the same table which is primary key of table
> event_sources. Looking in that table, you will clearly know with what
> event the related custom field is associated. :)
>
> I hope you understood my point.
>
> Thanks,
> Ramya
>
> -----Original Message-----
> From: Natu Lauchande [mailto:nlaucha...@gmail.com]
> Sent: Saturday, May 07, 2011 8:14 PM
> To: mifos-users@lists.sourceforge.net
> Subject: [Mifos-users] Get Data from Question Groups Associated with
> aSpecific Loan.
>
> Hi, All,
>
> We are using the new feature of Mifos 2.1 of question groups to better
> streamline and adapt client custom paper forms to MIFOS. I need to use
> some of this information within question groups in some critical
> operational reports, and i would like some guidance.
>
> For instance if i have a debit account number as a question within a
> question group(ex. Question Group Details)   that is associated to a
> create loan operation. I am studying the latest SchemaSpy and getting
> a bit lost on it.
>
> I could find so far the question related tables and understand it,
> because the naming and relationship is somewhat intuitive (Question,
> Question Groups, Sections, Instances), but i start to get a bit lost
> when i come across the concept of entity_id, event_source_id and
> really don't find a clear way to map it to a specific loan, client,
> etc....
>
> Cheers,
> Natu
>
> ------------------------------------------------------------------------
> ------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Mifos-users mailing list
> Mifos-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mifos-users
>
>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Mifos-users mailing list
> Mifos-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mifos-users
>

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Mifos-users mailing list
Mifos-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mifos-users

Reply via email to