Select unique column values in a start expression and get reference details from that column value

Hi,

I have a template built and I’m struggling with syntax.
I have a orders table and I want to get a list of all of the unique items a customer ordered and then display details of those items from the product table.
In the below it doesn’t recognise [ItemID#].[Name].
I’m assuming you can’t use a select like that in a start function? If not how do I get the unique values?

<<Start: Select(Orders[ItemID#], [Customer] = [_THISROW].[Customer], TRUE)>>
<<[ItemID#].[Name]>>
<<[ItemID#].[Description]>>
<<END>>

Any help would be much appreciated.
Cathal

Solved Solved
0 7 440
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Instead of this:

<<Start: Select(Orders[ItemID#], [Customer] = [_THISROW].[Customer], TRUE)>>
<<[ItemID#].[Name]>>
<<[ItemID#].[Description]>>
<<END>>

Try this:

<<Start: Select(Orders[ItemID#], [Customer] = [_THISROW].[Customer], TRUE)>>
<<[Name]>>
<<[Description]>>
<<END>>

View solution in original post

7 REPLIES 7

Is Item ID # the key of Orders table?

No there is a [OrderID#] that’s the key to that table. [ItemID#] is a reference to the product table.

Anyone have any insight on this one? It must be possible somehow.

Steve
Platinum 4
Platinum 4

Instead of this:

<<Start: Select(Orders[ItemID#], [Customer] = [_THISROW].[Customer], TRUE)>>
<<[ItemID#].[Name]>>
<<[ItemID#].[Description]>>
<<END>>

Try this:

<<Start: Select(Orders[ItemID#], [Customer] = [_THISROW].[Customer], TRUE)>>
<<[Name]>>
<<[Description]>>
<<END>>

Thanks a million @Steve, you nailed it as always. I honestly would never of thought of dropping the [ItemID#].

Within a pair of <<Start>> and <<End>> tags, direct column references (e.g., [Name]) refer to the row provided by the <<Start>> expression. Your <<Start>> expression provides a list of ItemID# values, so [Name] would refer to the Name column value of the row identified by the current ItemID# value.

@Steve - I am facing similar issue. I want distinct records from a column which is not the key column of that table, infact its a virtual column.

SELECT works only with key column but my purpose is not solved as I want distinct records of another column and If I use other column in the SELECT, it doesn't work.

Just wondering how is this working in that case?

Solved: Re: Template: Start expression + Select unique val... - Google Cloud Community

Top Labels in this Space