Question

I am trying to create a dashboard that consist from two components: CCC Bar chart and Multiple select component.

I use the multiply select component for assignment param value, which is using in the datasource. (MDX query):

SELECT
    NON EMPTY {[Measures].[doc_count]} ON COLUMNS,
    NON EMPTY {[Dimension Usage date_publish.Hierarchy date_publish].[date_publish].Members} ON ROWS
    FROM [Docs]
    WHERE CrossJoin({${param_hosts}}, {[event].[active]})

So if I set (multiply select component) property value array with pairs: ( {arg:[host].[news.com] value:news.com}, {{arg:[host].[somesite.com] value:somesite.com}} ), everything work perfect. The parameter is bound to the component receives the correct value, for example: [host]. [News.com], [host]. [Somesite.com].

But if I try to fill the multiply select component from the datasource it become unworkable. As DataSource, I use the sql over sqlJndi with query: SELECT distinct (host) as Id, concat ('[host]. [', Host, ']') as Value FROM docs_fact where dim_event_id = 1;

The result this query is a table:

id              value
news.com     | [host].[news.com]
somesite.com | [host].[somesite.com]

Parameter is assigned a value: news.com, somesite.com

Changing the properties of the Value as id only affects which of the fields (id or value) will be shown to the user, and the parameter's value is not affected.

Tell me please, is it possible to specify which of the columns to be used for display to the user and which of the columns to be used to generate results?

Was it helpful?

Solution

No, but you can change the dataset on the clientside using the postFetch function on the multi-select component.

function (dataset) {

    for (var i=0; i < dataset.resultset.length; i++) {
        var temp = dataset.resultset[i][0];
        dataset.resultset[i][0] = dataset.resultset[i][1];
        dataset.resultset[i][1] = temp;
    }

    return dataset; 
}

Or similar

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top