Hi Team, cc: <@U01N003F0RM> <@U02SNBLDP8X> <@U01Q...
# gooddata-ui
p
Hi Team, cc: @Martin Burian @Peter Plochan @Ivana Gasparekova I need a way to get details of MeasureValueFilter as we do for PositiveAttributeFilter and NegativeAttributeFilter using their
displayForm.
Note: we are using Goodata CN and Gooddata UI version 8.11.0. Regards, Prashant
For PositiveAttributeFilter and NegativeAttributeFilter, I am using the following query.
backend.attributes()
.elements()
.forDisplayForm(displayFormRef)
.withOptions({
uris: elementUris,
})
.query()
@Jan Soubusta @Peter Plochan Hi Team, any update on the same?
p
Hello, MeasureValue filter do not use attributes, therefore it does not have displayForm (label) as these are just view of the attributes. Measure value filter references a measure. In what detail are you interested in?
SPI service that you want to to get information about measure referenced by the filter is
backend..measures()
If you are looking for measure values, based on your example for attribute display form, these cannot be obtained in similar way as what you (possibly) asking about is a execution of the report: measure sliced by some attribute(s), therefore you would use AFM and
backend.execution()
SPI service that can get you values of a measure in various contexts.
Is that what you are after?
p
Hi @Petr Dolejsi, I need to get the title of measure.
I have the measure value filter in this format: { "measureValueFilter": { "condition": { "comparison": { "operator": "GREATER_THAN", "value": 1 } }, "measure": { "localIdentifier": "<some_id>" } } }
p
In this case
localIdentifier
points to a measure in either AFM or in
visualizationObject
(or
IInsight
, depends where you see this information). You will find it in one of the measure buckets. There will be a ref of the measure or its current title/alias.
From which structure you got the filter you posted?
The filter just references this measure. Without the outside context the filter definition itself does not say mean anything. It just defines that it filters some measure referenced by is local identifier that has meaning in the scope of the filter’s parent, not in workspace metadata model (therefore you cannot use SPI to get information about it).
p
Hi @Petr Dolejsi, I got this filter from insight data.
const insight = await backend
.workspace(workspace)
.insights().getInsight(idRef(INSIGHT_ID));
Here, the insight object contains a filters key from where I got this
measureValueFilter
object
I have the conditions and local identifier however, I don't have the title of the measure.
I need to display the filter something like
<Measure Title > GREATER THAN [value]
For example:
Sum of Marks GREATER THAN 80
@Petr Dolejsi, I do have a measure bucket definition. So, as per you the only way to get the measure title is to find it in measure bucket definition items against the local identifier I have.
p
From insight object that you got from
backend.workspace(…).insights().getInsight(ref)
you can call
.bucket.flatMap((bucket => bucket.items)).find(item => item.localIdentifier === measureValueFilter.measure.localIdentfier)
p
I see. Thanks.
p
That will get you
IAttributeOrMeasure
object. You can check the correct type via
isMeasure()
from
sdk-model
package and then you will get
IMeasure
object that has
title
and
alias
properties. Measure of the insight in our apps shows alias value if it is defined, if not it shows title. This way you should get the measure name.
p
That makes sense to me. Thanks @Petr Dolejsi.
p
Good luck with your project 🙌
❤️ 1
p
Hi @Petr Dolejsi, For InsightView do we have an option where we can fetch the insight irrespective of the user group. For Example, we have two user groups: Admin and Analyst. If I create an insight using Admin user group and then tries to access it from Analyst user group, it shows 404 not found for that insight On debugging, found the following: When we access the insight from Analyst usergroup, it appends <workspace-id>:<insight-id> in the insight url in place of normal <insight-id>
p
I don’t believe insights are tied to user groups in any way. Unless the other group do not have permission (at least VIEW level) for that particular workspace.
Someone more versed in GoodData CN could help you more, possibly @Peter Plochan?
j
WS prefixing is going to be changed. Cc @Jiri Schmid
p
@Jan Soubusta, which version are we targeting for this change? cc: @Balamurali Ananthan @Narinder Kumar @Sheila Loekito @Alex Kearns
p
Hi @Prashant Sharma, about the accessing the insight: Do your Analyst user group have proper access rights to the workspace where the insight was created? Or do you try to access it from the “child” workspace in the workspace hierarchy? From what you posted above, I can just guess, but I suppose you have something like this: •
Admin
group has
Organization.MANAGE
access = can “touch” everything in the organization. •
Analyst
group has access only to workspaces which are not parents in the workspace hierarchy. • You have workspace hierarchy with a parent workspace (let’s say it has
ws-parent
ID) and some child where the Analyst group has access (let’s say it has
ws-child
ID). ... you performed/tried to perform these operations: • As Admin, you created an insight (with
insight-id
ID) in
ws-parent
(
POST /api/v1/entities/workspaces/ws-parent/visualizationObjects
). • As Analyst, you wanted to access this insight in
ws-parent
(
GET /api/v1/entities/workspaces/ws-parent/visualizationObjects/insight-id
) -> you’ll get 404 because the you don’t have access rights to a ws-parent workspace. • As Analyst, you were able to access this insight in
ws-child
(
GET /api/v1/entities/workspaces/ws-child/visualizationObjects/ws-parent:insight-id
) because you have access rights to ws-child and the insight-id is inherited from the ws-parent workspace. Here, as @Jan Soubusta said, the explicit workspace prefixing will be removed in one of next GoodData.CN releases. Please, correct me if I’m not right. Thanks!
🙌 2
p
Hi @Peter Plochan, Your guess is completely right. Thanks for the confirmation.
🎉 1
Hi @Peter Plochan, @Petr Dolejsi, We have a lot of insights on a page in React. Is there a better way to download the page as PDF or an Image? Regards, Prashant
p
I’m not sure the support for whole Dashboard to PDF is supported yet. Possibly @Roman Hartig can provide more details.