Hi,
I have a pivot table with two metrics in the Rows segment which are weeks and days.
Is it possible by default that the 1st top row is expanded and the rest are collapsed? Such that with every new week added only the most recent row is expanded and all the others are collapsed.
Any help will be greatly appreciated, many thanks.
Riley
Hi @riley.anderson ,
Yes! You can set each field, individually, in a pivot table to default to ‘Expand’ or ‘Collapse’. In this example I’ve expanded the AdjustedSalesDate field (aggregated by week), but have collapsed the Category field:
Hope that helps.
ws
Hi @wstevens01,
Thank you for your response. I don’t think I was quite clear on what I wanted.
For the image below it has the current week expanded out into the secondary row field. Once that week is over and a new week begins I would want the ‘Week 40’ field to collapse and the new ‘Week 41’ field to be expanded. Such that only the top (most recent) week is expanded by default.
Any suggestions would be welcomed, many thanks.
Riley
Hi @riley.anderson ,
Ah! I see. You want to just expand the first value in that list of weeks at a given time. You’ll want the API for that.
I haven’t used these, but take a look the Action, PivotTableFieldCollapseStateOption. That Action takes a PivotTableFieldCollapseStateTarget which is an array of DataPathValues. Since DataPathValue is a Field Id, I suspect that it’s like the selecting Expand or Collapse in the Field Well, e.g. it’s for the whole field, not the first value in the list.
Also, PivotTableOptions, has a CollapsedRowDimensionsVisibility object that is either HIDDEN or VISIBLE. You might be able to set it.
Otherwise, you can only expand at the field level not the value level.
ws
Hi @wstevens01,
Thank you for confirming. I didn’t think it was possible directly through the Quicksight interface.
I will have to take a look at that sometime but seeing as it’s not something I’ve worked on before
it will probably take me longer to read up on it than it’s currently worth.
Many thanks,
Riley