Three quick questions

Hey Guys,

I’ve got 3 quick questions, and i don’t want to flood the forum with 3 posts so i’m merging all of them in here!

First of all, i am trying to make a calculation on ISO dates, but i can make it work how i want it.
I have a end field for example 2023-06-05T16:50:22.798Z , and a start field 2023-06-05 16:50:20.708Z . I want to have the difference in seconds, for example here 2.09s.
I am trying to combine parseDate and dateDiff but i got a bunch of error whatever i try. Can someone give me a good example of a calculated field working ? thanks
Found a solution myself : it was the ‘Z’ that was not in a supported format

Secondly, i have a table full a data, and i want to display only one item (if possible the last one, in terms of date createdAt the latest) for each different ID. Let me show you an example. I have a bunch of executions, with their differents status update. I added a calculated field that put the LAST value of the status field, so i always have the last status for this ID, in the item. But sadly it display all items so it looks like duplicate.

STATUS      - ID      - TIME                     - LASTSTATUS
-----------------------------------------------------------------------------------
SUCCESS     - execId1 - 2023-06-05T16:50:32.307Z - SUCCESS
IN_PROGRESS - execId1 - 2023-06-05T16:50:31.222Z - SUCCESS
SUCCESS     - execId2 - 2023-06-05T16:50:22.798Z - SUCCESS
IN_PROGRESS - execId2 - 2023-06-05T16:50:20.708Z - SUCCESS

I know that i can hide the column status that’s ok, it’s just here to display what’s happening for now. So how can i display just 1 item for each execId ?
I know that if in groupBy list there was only ID it would be fine, but then the field well would be missing data to calculate LASTSTATUS.
Is there an easy way to display only one item ?
Found solution myself : Building calculated field isLast with ifelse(maxOver(parseDate(createdAt, "yyyy-MM-dd'T'HH:mm:ss.SSS"), [actionId], PRE_AGG) = parseDate(createdAt, "yyyy-MM-dd'T'HH:mm:ss.SSS"), 1, 0) . Then filtering on the isLast param to check if it’s 1 and display

And last, it’s mostly an URL handling question. I have a general parameter, where i can pass the executionId that filter my whole dashboard to only one execution. Our authentication workflow is going through API call → generateSignedURL → send it to frontend → display dashboard.
The thing is, how do i say to quicksight that i want him to generate a signed URL with a #p.executionId param in the URL ? Is that possible ? If it’s not possible, maybe i need to change the authentication flow ? (We are using cognito + amplify in the front. Creating user with permissions and stuff in quicksight can be done if needed)

Thanks already for reading guys !! It means a lot. I hope i was clear, and it’s not too much of a flood. I’m really spending a lot a time and i feel like i’m not reaching anything.
Thanks again

Hi @hugob

It seems as though 1 & 2 are solved?

For 3 have you looked into passing parameters in the url? Is that what you are asking?

1 Like

Hey @Max

Thanks for answering that quick !
Yes i solved 1&2 myself, i just have an issue where parseDate always return midnight with the right date and bypass the time in my string, but i can figure that myself to avoid wasting your time!

Yes i know i can pass the parameter in the URL, works when i have the URL of the dashboard directly, but in my case i don’t have it. Let me explain a bit better :
1 - I use the GenerateEmbedUrlForRegisteredUserCommand from the quicksightSDK in my backend to get an URL to return to my frontend
2 - I get this long URL containing code for authentication and stuff, and open it in my web app
3 - When opened, this URL actually redirect me to the definitive shorter URL, and i see the dashboard

So if i add the #param in the end of the URL from end of point 3, it works fine. But the thing is i don’t have this URL before the redirection. And if i add my parameter in the URL from point 2, it just doesn’t work.
In the end i wanted to know if i can pass #param in the request for getting an embeded URL but it doesn’t seem like it right ?

Thanks again !

1 Like

Hey @Max

Really sorry to bother you again, but we’re basically stuck right now.

To put the context here again :
We got users logged into our web app, we want to show them an embedded dashboard in a page of our app.
So we generate a signed URL in the backend for this user and return it to the web app and then display it into an iframe.
But we NEED to have the query param “#p.id=123” on the URL, but the thing is when i generate a signed URL, this URL is not adaptable (i cannot add any param, if i do it just doesn’t work, because there is a redirection).

Is there a way to have this queryparam in the final URL ?
Or should we completely change the way we’re letting user see the dashboard (maybe mapping creds from cognito user pool to identity pool to do quicksight auth or something like that) ? (then the URL is the definitive one from the start and we can use query param)

I am so sorry to insiste, it’s just i am trying to figure out if i’m going into a wall or not

Really appreciate it

It’s me again!

We could make it work with the embedded-sdk

Thanks for your time again