How to pass a variable obtained from query component into a query on Pentaho CDE? - pentaho-cde

I managed to get data as variable with Query component.
Now I want to pass this variable into a query.
Here is what I did:
On Query Component: myresult='NYC' in my example.
The query on Datasources: I use this one to display a chart, when I change ${myresult} to 'NYC', it works fine. But with ${myresult}, the chart is not displayed.
I also tried with
> Dashboard.setParameter()
On post fetch of Query Component, but still the same...
I also created simple param and select param (which is not displayed on dashboard) but it doesn't solve the problem.
It's been hours I'm stuck , would love to get some help!
///////////////////////////////EDITED/////////////////////////////
On Component Panel - simple parameter :
On Component Panel - Pie chart - Parameters :
On Component Panel - Pie chart - listeners : I selected param_city
On Datasource - parameters of piechart query:

you need to pass parameter myresult and listner in Parameters field of both chart and datasource used for chart.

Related

Kendo spreadsheet rightmost column identification

I am new to Kendo world. And I need a help regarding the Kendo spreadsheet k-right class that's applied on the columns of spreadsheet.In my spreadsheet I have multiple tabs.each tabs can have different number of columns.But the last column is what I need as I need to bind a drop-down to the every row of that column for data selection. In my code I am using the class named k-spreadsheet-active-cell and k-right to identify the rightmost column position. But it's coming as undefined as k-right class is not getting applied. It's working fine for the tab which has max columns..for the lesser ones it's not getting applied.
Trying to read over Kendo site ,not getting any relevant info. Any help is hugely appreciated. Thanks.
You can handle the selectSheet event (documentation) to get the active spreadsheet when it changes.
You can then get the spreadsheet's column definitions by calling the toJSON method (documentation).
Finally you can get the last column definition by using some JavaScript (or jQuery) magic.
Here's an example that you can use when initializing the spreadsheet component:
selectSheet: function(arg) {
var json = arg.sheet.toJSON();
if (json.columns) {
var lastColumn = json.columns[json.columns.length - 1];
// do whatever it is you need to do with the lastColumn variable
}
}

Dashboard Hyperlink or Iframe URL: Filter Parameter Required

I have a dashboard made up of several dashlets (based on ad hoc views) and some filters.
I have set up a hyperlink on one dashlet that allows the user to click on a product and drill to another report.
The hyperlink needed to pass the Product in the Dashlet that the user clicks on as well as any selections made on the filters within the dashboard, for example filter the dashboard on certain Supplier Types.
I got this working using the following syntax: -
repo:/reportPath?$P{"p_SupplierType=",Supplier_Type_Filter , ? "&"}&p_Product=$P{Product Field}
This works fine.
THE PROBLEM
The issue is that if I don't select anything in my Supplier Type filter (i.e I want all Supplier Types) then I get an error telling me that Value for parameter 'Supplier_Type_Filter' is not set.
Anybody had the same or similar issues and have a solution or a workaround or even just an idea?
Thanks in advance.

AMChart handleClick to retrieve data from database based on item clicked

I'm using AMChart stacked chart to report test execution status from DB. Php file with query is feed into the dataLoader and the stacked columns displays Pass, Fail and NoRun count data for each category. I'm trying to use handleClick function to make the column clickable and once clicked, a query is fired to retrieve data specific to that column's Pass, Fail or NoRun count data and displays the data on the same page. I'm not sure how to implement this. Any help is greatly appreciated!
Below is all I have so far, clicking the column triggers an alert with name of the category and a count, my goal is to be able to trigger a php file with parameters passed in and display data from DB,
// add click listener
chart.addListener("clickGraphItem", handleClick);
function handleClick(event)
{
alert(event.item.category + ": " + event.item.values.value);
}
The issue has been resolved by using JSON (converted from DB data in PHP) and AJAX to display. Within handleClick I call another JS function and pass in the graph variables that the query inside PHP needs.

using ajax i am binding kendo grid in the date column it returns kendo grid returns /Date(1403789061723)/?

using ajax i am binding kendo grid in the date column it returns kendo grid returns /Date(1403789061723)/ other Fields are binding properly.In case of Normal binding its working perfectly.is there any way to fix this error...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Ok. The first thing I would ask is what is the model structure of your data that is being presented back to the grid.
I suspect that you are using a complex model that is not flattened eg. You have some custom classes with multiple properties within them.
If this is the case the grid and the datasource can not figure out what the actual data type is and treats anything not at the top level of data as a string.
To get around this either flatten out the viewmodel data that is being assigned to the grid or use the parsing functions to present the date back. Something like this should work:
columns.Bound(c => c.Date).ClientTemplate("#=kendo.format(\"{0:ddd, dd MMM yyyy}\",kendo.parseDate(Date))#")
Obviously putting what ever date time format you want.

View is returning random results when no filter is selected in Drupal. Why?

In drupal I have created a view to display node's title and added exposed filter for filtering content. When the view page is loaded it is returning two nodes, I do not know on what basis it is returning those two nodes. I want no result to be displayed until I select some value in filter. Please suggest?
Views is a query builder that starts with the simplest, broadest possible query, and filters are required to narrow that query to include only the items you wish. If you are familiar with SQL syntax, the default query would look something like this:
SELECT title, body FROM 'node'
This is why you're seeing two nodes when you load the page. There's no filter applied, so it's showing everything.
In order to get your View to only display items once the user has selected a value with the exposed filter, go into the Advanced > Exposed Form > Exposed Form Style and select Input required. I have tested this using Views 7.x-3.7 and I believe it will give you the behaviour you're looking for.

Resources