Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

need help....

Hi ,

My Table is

 

QuaterMonthsales
Q1jan1
Q1feb2
Q1mar3
Q2apr4
Q2may5
Q2june6
Q3july7
Q3aug8
Q3sep9
Q4oct10
Q4nov11
Q4dec12

and ouput should be sum of quaters should appear for each row

 

QuaterMonthsalesTotal
Q1jan16
Q1feb26
Q1mar36
Q2apr415
Q2may515
Q2jun615
Q3jul724
Q3aug824
Q3sep924
Q4oct1033
Q4nov1133
Q4dec1233

thanks

Ram

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

Table1:

Load * Inline

[

Quater,Month,sales

Q1,jan,1

Q1,feb,2

Q1,mar,3

Q2,apr,4

Q2,may,5

Q2,june,6

Q3,july,7

Q3,aug,8

Q3,sep,9

Q4,oct,10

Q4,nov,11

Q4,dec,12

];

Left Join

LOAD Quater, Sum(sales) as Total Resident Table1

Group by Quater;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
Gysbert_Wassenaar

Use sum(total <Quarter> sales) as expression for the Total column.


talk is cheap, supply exceeds demand
MayilVahanan

Hi

Try like this

Table1:

Load * Inline

[

Quater,Month,sales

Q1,jan,1

Q1,feb,2

Q1,mar,3

Q2,apr,4

Q2,may,5

Q2,june,6

Q3,july,7

Q3,aug,8

Q3,sep,9

Q4,oct,10

Q4,nov,11

Q4,dec,12

];

Left Join

LOAD Quater, Sum(sales) as Total Resident Table1

Group by Quater;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Hi ,

Try the code below:

Tab:

LOAD * INLINE [

    Quater, Month, sales

    Q1, jan, 1

    Q1, feb, 2

    Q1, mar, 3

    Q2, apr, 4

    Q2, may, 5

    Q2, june, 6

    Q3, july, 7

    Q3, aug, 8

    Q3, sep, 9

    Q4, oct, 10

    Q4, nov, 11

    Q4, dec, 12

];

Tab1:

LOAD Quater,

  Sum(sales) as Total

  Resident Tab Group By Quater Order By Quater;

Not applicable
Author

Hi Ramasamy,

Thank for ur reply...