extensions-api icon indicating copy to clipboard operation
extensions-api copied to clipboard

Extensions and MeasureNames

Open tb582 opened this issue 5 years ago • 6 comments

I have a quick extension but I'm not seeing all the values I'd expect with getting summary data .... some of the 'measure names' show up like

"Measure Names":"[federated.046k1331msvlds18os0bt1p7zpww].[usr:Calculation_166422086083043330:qk]"

How can I tie this back to something within the tableau UI ?

Assuming I have to rename something but I don't have any calculated fields with the name(s) above.

tb582 avatar Jul 23 '19 15:07 tb582

Hello! Normally the UI will show you the caption rather than the official field name. Are you looking at a Field object? If so, you should be able to get both it's Id, which would be something like you have above, and its name, which should be the caption that you see in the UI.

But it sounds like you are looking at the results of getSummaryDataAsync, which should give you the name. Is it possible to share the workbook, either here, or privately? John

johnDance avatar Jul 24 '19 16:07 johnDance

@johnDance send you an email to your tableau email (if I got it right)

tb582 avatar Jul 24 '19 17:07 tb582

You guessed correctly. 👍

johnDance avatar Jul 24 '19 17:07 johnDance

@tb582 gave me a little background information. Here is what we discovered...

When you put “Measure Names” on the shelf, the data of that are the names of your measure fields. That is what you are seeing in the values in GetSummaryDataAsync. Since the fields like GAP, and others are calculated fields, the value is the field name (actually field id) of the calculated field.

[federated.046k1331msvlds18os0bt1p7zpww].[usr:Calculation_166422086083043330:qk]

As you mention, this isn’t very helpful if you really want to know what field that is. You can find the field caption (which is what you see in the UI), in datavalue.formattedValue.

In datavalue.value, you get the fieldID, and in datavalue.formattedValue, you get the caption (or user friendly name).

If you want to tie this back to an actual field, you can get the fields in your datasource, and compare datavalue.value against field.id, or datavalue.formattedValue against field.name.

John

johnDance avatar Jul 25 '19 16:07 johnDance

seems like another reason we might want fieldId on Column https://github.com/tableau/extensions-api/issues/207

tjallingt avatar Aug 06 '19 08:08 tjallingt

Thanks for the link. I've added that issue to our internal issue tracker.

johnDance avatar Aug 06 '19 18:08 johnDance

The fieldId is now part of the column information. This is since 1.5.

johnDance avatar Dec 29 '22 00:12 johnDance