Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rdegr
Helper I
Helper I

in selector json what is the 't' attribute

"{"selector":"{\"data\":[\"{\\\"comp\\\":{\\\"k\\\":0,\\\"l\\\":{\\\"col\\\":{\\\"s\\\":{\\\"e\\\":\\\"qtEmergencyRecords\\\"},\\\"r\\\":\\\"Year\\\"}},\\\"r\\\":{\\\"const\\\":{\\\"t\\\":4,\\\"v\\\":2017}}}}\"]}","highlight":false}"


"{"selector":"{\"data\":[\"{\\\"comp\\\":{\\\"k\\\":0,\\\"l\\\":{\\\"col\\\":{\\\"s\\\":{\\\"e\\\":\\\"qtFacility\\\"},\\\"r\\\":\\\"Facility County\\\"}},\\\"r\\\":{\\\"const\\\":{\\\"t\\\":1,\\\"v\\\":\\\"Baker\\\"}}}}\"]}","highlight":false}"

 

Seems like some sort of type code but doesn't match anything I see in metadata.  Please advise.  I am trying to build a filter that lets me select table/column, then value, but the generated selectors build filters across all the columns I've added to the control. so I'd like to build simple filters as above manually.

1 ACCEPTED SOLUTION

Hi @rdegr,

 

I had a similar request andwas able to solve it in the following was:

 

1. I create an array of custom identities, in this case it uses the category as text, but that can be changed to SQExprBuilder.number if needed.

let categoryIdentities = categories.map((category) => {
    let sqlExpr = powerbi["data"].SQExprBuilder.equal(dataView.metadata.columns[0].expr, powerbi["data"].SQExprBuilder.text(category));
    return powerbi["data"].createDataViewScopeIdentity(sqlExpr);
});

# ref: https://github.com/liprec/powerbi-boxWhiskerChart/blob/89179879a7209b030245fd05c317eee2034db394/src/boxWhiskerChart.ts#L260

2. When I loop thru the individual catagories (=i variable)I use the following code to create the correct SelectionId identifier:

let selectionId = new SelectionId({ data: [ categoryIdentities[i] ] }, false);

# ref: https://github.com/liprec/powerbi-boxWhiskerChart/blob/89179879a7209b030245fd05c317eee2034db394/src/boxWhiskerChart.ts#L282

I added links to my solution for more reference and hope this can also work for your visual.

 

-JP

View solution in original post

16 REPLIES 16

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors