KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Undefined Column names By using Cube Process #947

Open Sowmya opened this topic on on Jun 26, 2019 - 6 comments

Sowmya commented on Jun 26, 2019

Hi KoolReport team, I am KoolReport Pro User..... I tried CUBE process, But no use. It gives me error message. " My column names are undefined...." Actually my data in the format of

CostCenter            MonName    MonField    MonYear        InvValue
Manufacturing	        April	    4	       2019	    ********
Rental	                April	    4	       2019	    ********
Service	                April	    4	       2019	    ********
Spares	                April     4	       2019	    *********
Traded	                April	    4	       2019	    0	                    

Like this I have " May, June" Invoices are there in my Database.... This data I stored in a "view(Ms SQL Server)".

My Code is ::

$this->src('invoice')
		->query("select MonName,CostCentre,InvoiceValue
				from vw_MonthWiseSalesSummeries
				order by MonField,MonName,CostCentre")
		
	    ->pipe(new Cube(array(
            "row" => "MonName",
            "column" => "CostCentre",
            "sum" => "InvoiceValue"
        )))
        ->pipe($this->dataStore('Quarter_Sales'));

Now I want to generate Koolreport of "Area or Line chart or Bar chart......

Kindly Please give the solution as early as possible. Bacause I'm struggling with this task from last 3days. I have to submit this task. Here I'm only Koolreport user. Please support me.

                             Thank you so much in advance.....
KoolReport commented on Jun 26, 2019

Please check the name of InvoiceValue as I see you use InvValue as well. Not sure which name is correct.

Sowmya commented on Jun 27, 2019

I used InvoiceValue only... Due to data representation in table I mentioned like that only. My Query is

create view vw_MonthWiseSalesSummeries as
select CostCentre,DATENAME(MONTH,Month) as MonName,MONTH(Month) as MonField,
    YEAR(Month) as YearField,SUM(InvValue) as InvoiceValue, SUM(InvQTY) as InvoiceQty
from MonthWiseSalesSummeries
group by CostCentre,DATENAME(MONTH,Month),MONTH(Month),YEAR(Month)

David Winterburn commented on Jun 27, 2019

Hi Sowmya,

Would you please post the exact error message? By the way, when you use the Cube process, there's no need to do sum (or count) group before hand. Just this one is enough:

$this->src('invoice')
		->query("select CostCentre,DATENAME(MONTH,Month) as MonName,MONTH(Month) as MonField,
    YEAR(Month) as YearField, InvValue, InvQTY
from MonthWiseSalesSummeries")
		
	    ->pipe(new Cube(array(
            "rows" => "MonName",
            "columns" => "CostCentre",
            "sum" => "InvValue"
        )))
        ->pipe($this->dataStore('Quarter_Sales'));

Please try this and let us know the result or exact error messages. Thanks!

Sowmya commented on Jun 27, 2019

To send exact my Error, Your editor does not support Image loading. I want to send my resultent graph to you. Then u can easily understand my Problem. I have Invoice Value in my Database From "0 TO 100000000." I want to show my Invoice Value(on Y-Axis), MonName(on X-Axis). I have to show graph for each COSTCENTER(Manifacturing,Rental,Spares,Services,Traded) Fluctuations for the April,May,June Months.... I want to design graph as following on URL(2nd Diagram ie Column Chart) Please check this URL https://www.koolreport.com/examples/reports/cube/cube_customers_vs_categories/

David Winterburn commented on Jun 27, 2019

Hi Sowmya,

Just print screenshots of your page including the error messages and post them here. Thanks!

Sowmya commented on Jun 27, 2019

Hi David, I sended my screen, data and code to KoolReport support@koolreport.com, from My ID Sowmya sowmya.g@icsoft.co.in. If possible, can You check it once.....

Thank you so much, for your response. Please provide me the solution... Here attachments are not supported.....

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

Cube