cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rdegr Regular Visitor
Regular Visitor

Re: in selector json what is the 't' attribute

I'm not trying to add extra columns, but to work around them being added when I don't want. Your SQLExprBuilder code was helpful to me, it replaced about 20 lines where I was building a selector object from scratch. Thanks!

rdegr Regular Visitor
Regular Visitor

Re: in selector json what is the 't' attribute

I've solved my problem and will select the most helpful of these replies as (part of) the solution.  For the issue of being limited to 30K values I preloaded values for known columns.

 

module DistinctValues {

    export var qtEmergencyRecords:any = {};
    
    qtEmergencyRecords["Year"] = [ 2016, 2017 ];    

    export var qtFacility:any = {};

    qtFacility["Facility County"] = [
        "Alachua",
        "Baker",
        "Bay",
        "Bradford",
        ...

then in processing a category "cat"

                    let arr = cat.values;
                    if (DistinctValues[expr.source.entity])
                    {
                        let dvs = DistinctValues[expr.source.entity];

                        if (dvs[expr.ref] && dvs[expr.ref].length)
                        {
                            arr = dvs[expr.ref];
                        }
                    }
                    
                    arr.forEach((val:any, valIndex:number) => {
jppp
Advisor

Re: in selector json what is the 't' attribute

You should be able to construct all needed filters/selectors with the `SQExprBuilder` as Power BI itself is using the same.

Or you are trying to create something that Power BI doesn't understand.

 

-JP

rdegr Regular Visitor
Regular Visitor

Re: in selector json what is the 't' attribute

My problem is it wants to cross-reference the columns I've added.  If I add a column with two distinct values, then another with 100, then I get 200 "values" for the first column, one for every combo of the two.  And 

 

                            this.selectionIds[val+''] = this.host.createSelectionIdBuilder()
                                 .withCategory(cat, valIndex)
                                 .createSelectionId();

creates filters that apply to both columns.

 

I used your example to build a selector for just the column I care about.  

Moderator v-viig
Moderator

Re: in selector json what is the 't' attribute

Please note SQExprBuilder is not documented as official API. It might be removed or changed without any notification.

 

If you need some specific API please send us details to pbicvsupport@microsoft.com

Otherwise, you might get unexpected breaks.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

rdegr Regular Visitor
Regular Visitor

Re: in selector json what is the 't' attribute

Thank you, that is useful to know.  I'm on 1.5 currently as some samples I looked at early on didn't work with 2.x.  This is for a single app of ours, we don't plan to try to publish it publicly.

Highlighted
Moderator v-viig
Moderator

Re: in selector json what is the 't' attribute

Got you. API 2.1.0 removed use internal interfaces to make API lighter.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com