Hi Team, cc: <@U02SNBLDP8X> <@U02H1CTHAQ1> <@U01N...
# gooddata-cn
p
Hi Team, cc: @Peter Plochan @Petr Dolejsi @Martin Burian @Robert Moucha @Narinder Kumar For some Grid insights, we the getting the following error for the following API: <https://<Gooddata%20URL>/api/v1/actions/workspaces/<Workspace_Id>/execution/afm/execute/result/<unique_id>?offset=0%2C0&limit=10%2C100|https://<Gooddata URL>/api/v1/actions/workspaces/<Workspace_Id>/execution/afm/execute/result/<unique_id>?offset=0%2C0&limit=10%2C100> Before the above API, we have an
execute API
which gives as executionResponse. Note: The issue is intermittent.
r
offset=0%2C0&limit=10%2C100
uri-decoded means:
Copy code
offset=0,0
limit=10,100
This means the resultSpec must have exactly 2 dimensions. The error suggests that returned resultSpec for given AFM request has only one dimension.
check the resonse of the corresponding AFM execute call to see how many dimensions the request has.
p
How can we send the dimensions @Robert Moucha? Is there a way to determine whether to send a single dimension or multiple?
FYI, We are using the following query for execution:
gdAnalyticalWorkspace.execution()
.forBuckets(insightBuckets, filters
.withSorting(sortingItems)
.execute()
.then((executionResult) => {
//response
}).catch(e => console.error(e));
The AFM execute call shows only one dimension:
Hi Team, @Peter Plochan @Petr Dolejsi @Martin Burian @Robert Moucha, Please find the complete details of the issue below: 1. The payload of the Working AFM execute call using InsightView Gooddata UI component contains two dimensions(dim_0 and dim_1) with item Identifiers for dim_1 are empty arrays as we don't have any measure in the insight. 2. However, when we generate the custom AFM execute call using the following statement :
gdAnalyticalWorkspace.execution()
.forBuckets(insightBuckets, filters
.withSorting(sortingItems)
.execute()
.then((executionResult) => {
//response
}).catch(e => console.error(e));
the payload only contains 1 dimension ie. dim_0. I believe this one is automatically generated using the
dimensionGenerator
as the insight contains only one attribute and no measure. Ideally, as we have only one attribute with no measure in the insight, there shouldn't be any second dimension with the payload. However, with InsightView component, the second dimension for measures with an empty
itemIdentifiers
is going along with the API hence the API works. If sending the empty itemIdentifers in dim_1 is the only solution, then it should go along with the custom AFM execute call as well. Kindly look into the issue and let us know if there's any fix available.
Any update on the issue, please? @Robert Moucha
d
Hi, @Prashant Sharma the dimensions are automatically generated, but you can influence/override them to match your needs using the
withDimensions
call in the builder (similar to
withSorting
). There are factory functions in
@gooddata/sdk-model
that will help you create the executions: • newDimensionnewTwoDimensional Also for some inspiration/real life example, here is how our BarChart generates the dimensions.
The dimensions really depend on how you want to use the data, that is why it is different per visualization type even when they have the same buckets
p
Thanks, @Dan Homola for the response. That really makes sense to me. However, shouldn't the default dimension generator work for each case if we don't want to customise the dimensions.
m
Hello @Prashant Sharma Please can you share more details how are you reading the execution data? Are you calling
.readAll()
?
p
Hi @Matyáš Kandl, this is
.executionResult.readWindow([ 0, startRow ], [ 10, endRow ])
m
From the previous responses, it seems you are calling
readWindow([0, 0], [100, 10])
which does not make sense for 1 dimension.
Every number in these arrays = 1 dimension. So for 1 dimension, you want something like
.readWindow([dim1_result_offset], [dim1_result_size])
p
Is there any documentation around the same?
The grid keeps loading if I try with
readAll
m
p
Thanks, @Matyáš Kandl. I will look into docs and get back if required.
m
@Prashant Sharma Np, l hope it helps 🙂
👍 1
p
Thanks, @Matyáš Kandl. The solution worked for us. Appreciate your help.
🙌 1
Hi @Matyáš Kandl, is there a way to preload Analytical Designer? We are loading it in a Modal using iframe in our App. The issue is, it takes a lot of time while loading the iframe.
p
You can have iframe hidden and AD load in it right when the app renders and then display the iframe when you need it. AD should be loaded by then. Our KPI dashboards do the same. In our case, actual preload starts to happen when KPI dashboards app finishes its initialization
p
@Petr Dolejsi, we have the AD in a Modal. If we hides the Modal for preloading, we will loose its animation unless develops something from scratch.
Is there a example code which you can provide?
p
Sorry, I don’t. It’s just
<iframe src="AD_URL" style="display: none" />
src
starts as
about:black
, when KPI dashboards are loaded,
src
is set to URL of AD, when overlay with AD is supposed to be displayed,
display
style property is changed to
block
. Something in this vein is happening there.
p
Even if we hide the iframe, when we open the Modal, the iframe will re-render. Isn't it the case?
p
That really depends on your Modal implementation.
p
Alright. Thanks for the information.
p
Happy to help