[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: [sqr-users] Transposing rows to columns
- Subject: Re: [sqr-users] Transposing rows to columns
- From: Jiju <jijucvengal@gmail.com>
- Date: Fri, 9 Mar 2007 02:41:35 +0530
- Delivery-date: Thu, 08 Mar 2007 16:13:50 -0500
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta;h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;b=HBLS/aPEA/7TPsCH48r5w8T9w6tHKKewunm6obGk8VuK9Bu9bXSM7e2zGxsFmYg6om/31BraRbhRaEqWE4Lp5BSTJtQXD3CtjKAHnx4FhJ4v6NEgZ1dtUOztioO3PsuEm2mJK0mkVgkT2jUbA1DV7wapt6kzRxZxcU157gk8wxI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta;h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references;b=MthhpwEiLWnQNoZhxM9INTOcPfuusP0lkWEzovyvQGIZc4yDCTD+NWWdx1DuCNgzwJmi2D2Rh69CCGyLsTP6f4G6yx2f931TYSQqz2iatV8O5aoADEx0/b8m6pA3TQMizBuzvOFgWM7YIbXaKNZkf88ZyyyQgjz6Lsj7/L1szjU=
- In-reply-to: <565047.52113.qm@web34614.mail.mud.yahoo.com>
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
- References: <565047.52113.qm@web34614.mail.mud.yahoo.com>
Hi Ram,
Though I am a bit confused about how you would handle all the scenarios,
(like what happens if there are more than two rows that have the same Seq No
and PayEndDt values, where do we append that?), I would may be use arrays to
implement this...Read the contents of the file into an array, fetch the
values of a row # i and compare with row # (i-1) and write to the file
accordingly.
Regards,
Jiju.
On 3/9/07, Arun Kumar <arunkumar13@yahoo.com> wrote:
>
> If I am reading your statement "if any one of the above first 2 column
> values (Seq No or Pay End Dt)
> changes then I want to write it as a row else append to the same row"
>
> Seq No Pay End Date Plan Type-10 Amount Plan Type-11 Amount
>
> 1 Jan 10 $20 $0
> 1 Feb 10 $15 $20
>
>
> Right????
>
> But I any way ... You can do this by building/concating string $variable
> before writing to the file.
>
> Also you can use on-break on the sql statement.
>
> HTH...
>
>
>
> ----- Original Message ----
> From: "Vaidyanathan, Ramakrishnan (GE, Corporate, consultant)" <
> ramakrishnan.vaidyanathan@ge.com>
> To: sqr-users@sqrug.org
> Sent: Thursday, March 8, 2007 3:04:32 PM
> Subject: [sqr-users] Transposing rows to columns
>
> Hi All,
>
> Can anyone help me with the logic on how to display the row values as
> columns from a table. For eg. the table contains the data in the below
> format
>
> Seq No Pay End Dt Plan Type Amount
> 1 Jan 10 $20
> 1 Jan 10 $0
> 1 Feb 10 $15
> 1 Feb 11 $20
>
> If any one of the above first 2 column values (Seq No or Pay End Dt)
> changes then I want to write it as a row else append to the same row. I want
> the output to be written to a file in the following format
>
> Seq No Pay End Date Plan Type-10 Amount Plan Type-11 Amount
>
> 1 Jan 10 $20
> 1 Jan 10 $0
> 1 Feb 10 $15 $20
>
> please help me with the logic to do this.
>
> Thanks
> Ram
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>
>
>
>
>
>
>
>
>
>
>____________________________________________________________________________________
> Get your own web address.
> Have a HUGE year through Yahoo! Small Business.
> http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
>
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users