Yii Framework Forum: [Ask] Crosstab Tampilan Cgridview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Ask] Crosstab Tampilan Cgridview Rate Topic: -----

#1 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 10 January 2013 - 12:11 AM

misi gan,
ada yang bisa bantu??
gini,
saya ad permasalahan,
saya sudah nampilin data kya gini :

Attached File  grid1.png (21.15K)
Number of downloads: 20


saya pengen nampilin data kya gini :

Attached File  grid2.png (9.41K)
Number of downloads: 22

apakah ada pencerahan??
terimakasih. . .
0

#2 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 10 January 2013 - 10:41 PM

View Postmrkoeh, on 10 January 2013 - 12:11 AM, said:

misi gan,
ada yang bisa bantu??
gini,
saya ad permasalahan,
saya sudah nampilin data kya gini :

Attachment grid1.png


saya pengen nampilin data kya gini :

Attachment grid2.png

apakah ada pencerahan??
terimakasih. . .


udah SOLVED gan,
kita main di query nya ajah,hehehe. . . . :D
0

#3 User is offline   alvina 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-December 10

Posted 19 February 2013 - 12:34 PM

View Postmrkoeh, on 10 January 2013 - 10:41 PM, said:

udah SOLVED gan,
kita main di query nya ajah,hehehe. . . . :D


Contoh Querynya gimana gan ?
0

#4 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 19 February 2013 - 09:12 PM

View Postalvina, on 19 February 2013 - 12:34 PM, said:

Contoh Querynya gimana gan ?


begini gan, kasus saya ambil data dari 2 tabel dan fieldny pun gak berubah, jadi di bikin view ajah. . .hehehe

CREATE OR REPLACE VIEW view_penyusutan_gol_per_tahun
AS
SELECT G.kd_gol, G.ur_gol,
	SUM(IF(thn_ang='2006',FLOOR(M.rph_aset),0)) AS 'thn_2006',
	SUM(IF(thn_ang='2007',FLOOR(M.rph_aset),0)) AS 'thn_2007',
	SUM(IF(thn_ang='2008',FLOOR(M.rph_aset),0)) AS 'thn_2008',
	SUM(IF(thn_ang='2009',FLOOR(M.rph_aset),0)) AS 'thn_2009',
	SUM(IF(thn_ang='2010',FLOOR(M.rph_aset),0)) AS 'thn_2010',
	SUM(IF(thn_ang='2011',FLOOR(M.rph_aset),0)) AS 'thn_2011',
SUM(M.rph_aset) AS Total
FROM dbbmn10.t_masterhm M, t_gol_umeko G
WHERE G.kd_gol = SUBSTR(M.kd_brg,1,1)
AND M.thn_ang != '0'
GROUP BY G.ur_gol
ORDER BY G.kd_gol ASC


Semoga bisa membantu gan, , ,
CMIIW
0

#5 User is offline   alvina 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-December 10

Posted 19 February 2013 - 10:51 PM

View Postmrkoeh, on 19 February 2013 - 09:12 PM, said:

begini gan, kasus saya ambil data dari 2 tabel dan fieldny pun gak berubah, jadi di bikin view ajah. . .hehehe

CREATE OR REPLACE VIEW view_penyusutan_gol_per_tahun
AS
SELECT G.kd_gol, G.ur_gol,
	SUM(IF(thn_ang='2006',FLOOR(M.rph_aset),0)) AS 'thn_2006',
	SUM(IF(thn_ang='2007',FLOOR(M.rph_aset),0)) AS 'thn_2007',
	SUM(IF(thn_ang='2008',FLOOR(M.rph_aset),0)) AS 'thn_2008',
	SUM(IF(thn_ang='2009',FLOOR(M.rph_aset),0)) AS 'thn_2009',
	SUM(IF(thn_ang='2010',FLOOR(M.rph_aset),0)) AS 'thn_2010',
	SUM(IF(thn_ang='2011',FLOOR(M.rph_aset),0)) AS 'thn_2011',
SUM(M.rph_aset) AS Total
FROM dbbmn10.t_masterhm M, t_gol_umeko G
WHERE G.kd_gol = SUBSTR(M.kd_brg,1,1)
AND M.thn_ang != '0'
GROUP BY G.ur_gol
ORDER BY G.kd_gol ASC


Semoga bisa membantu gan, , ,
CMIIW


Makasih Gan :rolleyes:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users