Within a field group multiple values.

7 views
Skip to first unread message

Carlos F Gonzalez

unread,
Feb 7, 2012, 8:54:14 AM2/7/12
to InterSystems: MV Community
Hello, my name is Carlos and I have the following problem.

I have a query that returns the following records:

# ID MiddleAndLastName TestAbreviation SampleID

1 29802774 Gonzalez GLU 1
2 7 Torres GLU 4
3 7 Torres URAT 4


But I need to group it like this:

# ID MiddleAndLastName TestAbreviation SampleID

1 29802774 Gonzalez GLU 1
2 7 Torres GLU URAT 4


Is there a query that does this return?

Sorry for my English, I'm a beginner in Intersystem Cache.

Thank you very much everyone!

Rich Taylor

unread,
Feb 7, 2012, 9:46:58 AM2/7/12
to intersy...@googlegroups.com
Carlos,

What language are you writing this query in? SQL, CMQL (access)?

If the later, meaning you are coming from a Multivalue environment, can you give use the data dictionary for this file? It would also be helpful to see the data so if you ED filename 3 and take a screen paint of the relevant area(s) of the data.

Richard S Taylor
Sales Engineer
InterSystems Corporation
Office: 443-340-8614
FAX: 440-815-5805

--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To post to this group, send email to Cac...@googlegroups.com
To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CacheMV?hl=en

Message has been deleted

Jason Warner

unread,
Feb 7, 2012, 12:08:54 PM2/7/12
to intersy...@googlegroups.com
Based on http://docs.intersystems.com/cache20111/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_list, it looks like you want to re-write your query like:

SELECT rOrders -> RegisterDate ,
    rOrders -> ID1 ,
    rOrders -> rPatients -> PatientID1 ,
    rOrders -> rPatients -> MiddleAndLastName ,
    LIST(DISTINCT rTests -> TestAbbreviation)
FROM tOrderTests
WHERE tOrderTests . Status = 0

Jason

On Tuesday, February 07, 2012 8:27:24 AM, Carlos F Gonzalez wrote:

The query I use is:

SELECT rOrders -> RegisterDate ,
rOrders -> ID1 ,
rOrders -> rPatients -> PatientID1 ,
rOrders -> rPatients -> MiddleAndLastName ,
rTests -> TestAbbreviation
FROM tOrderTests
WHERE tOrderTests . Status = 0

I place this query in a tablePane in the SQL property. In Intersystem
Studio.

I send you a printscreen, by mail.

Unfortunately the database I can not send for terms of Confidentiality
For more options, visit this group athttp://groups.google.com/group/CacheMV?hl=en- Ocultar texto de la cita -

- Mostrar texto de la cita -

Rich Taylor

unread,
Feb 7, 2012, 12:51:35 PM2/7/12
to intersy...@googlegroups.com

Carlos,

 

Jason beat me to the punch here.   This does look like what you are trying to achieve.    Also, for future reference, InterSystems has  a number on online communities.  There is a general Caché community and one focused on ZEN.  You will probably get better response by including these in your postings also.  This group in particular is focused on the Multivalue aspects of Caché hence my first request to clarify the type of query you were doing.  Here are some links to those other groups

 

http://groups.google.com/group/intersystems-public-cache?pli=1

 

http://groups.google.com/group/InterSystems-ZEN

 

Richard S Taylor
Sales Engineer
InterSystems Corporation
Office: 443-340-8614
FAX: 440-815-5805

image003

Carlos F Gonzalez

unread,
Feb 7, 2012, 1:08:01 PM2/7/12
to InterSystems: MV Community
Well, it really helped me and I thank them.

After Jason's response, and the link PROVIDED BY Richard, I found the
solution as follows:

SELECT rOrders -> RegisterDate ,
rOrders -> ID1 ,
rOrders -> rPatients -> PatientID1 ,
rOrders -> rPatients -> MiddleAndLastName ,

LIST(DISTINCT rTests -> TestAbbreviation %FOREACH(rOrders ->
ID1 ))

FROM tOrderTests
WHERE tOrderTests . Status = 0

Thank you very much for everything!!


On 7 feb, 14:51, Rich Taylor <Rich.Tay...@intersystems.com> wrote:
> Carlos,
>
> Jason beat me to the punch here.   This does look like what you are trying to achieve.    Also, for future reference, InterSystems has  a number on online communities.  There is a general Caché community and one focused on ZEN.  You will probably get better response by including these in your postings also.  This group in particular is focused on the Multivalue aspects of Caché hence my first request to clarify the type of query you were doing.  Here are some links to those other groups
>
> http://groups.google.com/group/intersystems-public-cache?pli=1
>
> http://groups.google.com/group/InterSystems-ZEN
>
> Richard S Taylor
> Sales Engineer
> InterSystems Corporation
> Office: 443-340-8614
> FAX: 440-815-5805
> [image003]
>
> From: intersy...@googlegroups.com [mailto:intersy...@googlegroups.com] On Behalf Of Jason Warner
> Sent: Tuesday, February 07, 2012 12:10 PM
> To: intersy...@googlegroups.com
> Subject: Re: [InterSystems-MV] Re: Within a field group multiple values.
>
> Based onhttp://docs.intersystems.com/cache20111/csp/docbook/DocBook.UI.Page.c..., it looks like you want to re-write your query like:
>
> SELECT rOrders -> RegisterDate ,
>     rOrders -> ID1 ,
>     rOrders -> rPatients -> PatientID1 ,
>     rOrders -> rPatients -> MiddleAndLastName ,
>     LIST(DISTINCT rTests -> TestAbbreviation)
> FROM tOrderTests
> WHERE tOrderTests . Status = 0
>
> Jason
>
> On Tuesday, February 07, 2012 8:27:24 AM, Carlos F Gonzalez wrote:
>
> The query I use is:
>
> SELECT rOrders -> RegisterDate ,
> rOrders -> ID1 ,
> rOrders -> rPatients -> PatientID1 ,
> rOrders -> rPatients -> MiddleAndLastName ,
> rTests -> TestAbbreviation
> FROM tOrderTests
> WHERE tOrderTests . Status = 0
>
> I place this query in a tablePane in the SQL property. In Intersystem
> Studio.
>
> I send you a printscreen, by mail.
>
> Unfortunately the database I can not send for terms of Confidentiality
>
> Thank you very much everyone!
>
> To post to this group, send email to Cac...@googlegroups.com<mailto:Cac...@googlegroups.com>
> To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com<mailto:CacheMV-unsubscribe@googlegroup­s.com>
> For more options, visit this group athttp://groups.google.com/group/CacheMV?hl=en-Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
>
> --
> You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
> To post to this group, send email to Cac...@googlegroups.com
> To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/CacheMV?hl=en
>
>
>
>  image001.jpg
> 4 KVerDescargar- Ocultar texto de la cita -
Reply all
Reply to author
Forward
0 new messages