Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Group by with nested start expressions and formatting in PDF template

Hi there,
I've read a lot of the community forum posts on this topic but I still cannot seem to get it right for my specific use case.

I have a table ("Control") in my app connected to this data:

tjr2484_0-1717410367316.png

My current template looks like this:

tjr2484_1-1717410443585.png

Author table column:
<<Start:ORDERBY(UNIQUE(Control[Key]), [Author])>><<IF: [Key] = INDEX(ORDERBY(UNIQUE(Control[Key]), [Author]),1)>><<[Author]>><<ENDIF>>

Genre and Book column:
<<Start:ORDERBY(UNIQUE(SELECT(Control[Key], [Author] = [_THISROW-1].[Author])), [Genre])>><<[Genre]>>:<<Start:SELECT(Control[Key], AND([Author] = [_THISROW-2].[Author], [Genre] = [_THISROW-1].[Genre]))>><<[Book_Title]>><<End>><<End>><<End>>

Here is what my PDF output looks like currently, the rows are being repeated for each author record (as blank), regardless if the previous was the same as the current. tjr2484_2-1717410667866.png

 

And my objective is the have the output look like this:

tjr2484_0-1717411300630.png

My question is in two parts, one for group and one for the formatting.

Q1. How do I display the Author in single row, considering there are multiple rows of the same author in my data?

Q2. How do I ensure the formatting of the Genre and Book sits each on a new line, rather than clumped together as a single piece of text? Note that the Genre is bold with the colon. Is this possible?

Thanks a lot in advance, really appreciate it.

 

 

 

 

 

 

 

 

 

0 3 318
3 REPLIES 3

As I pointed out in a recent Q&A, you should use Steve's formula.

Data:

TeeSee1_3-1717417210931.png

Template:

TeeSee1_4-1717417231020.png

//Author Col
<<Start: ORDERBY(FILTER(“AUTHORSHIP”,[_RowNumber]=MIN(SELECT(AUTHORSHIP[_RowNumber],[Author]=[_THISROW-1].[Author]))),[Author])>>
<<[Author]>>

//Genre and Books
<<Start: ORDERBY(FILTER(“AUTHORSHIP”,[_RowNumber]=MIN(SELECT(AUTHORSHIP[_RowNumber],AND([Author]=[_THISROW-2].[Author],[Genre]=[_THISROW-1].[Genre])))),[Genre])>>
<<[Genre]>>:
<<Start:FILTER(“AUTHORSHIP”,AND([Author]=[_THISROW-2].[Author],[Genre]=[_THISROW-1].[Genre]))>>
<<[Book_Title]>>
<<End>>

<<End>>
<<End>>

Result:

TeeSee1_5-1717417347787.png

 

 

Nice one @TeeSee1 👍

Hi @TeeSee1 , thanks for your suggestion, I will try this out and let you know.

Top Labels in this Space