AnsweredAssumed Answered

Short value list from many similar records

Question asked by Stu412 on Mar 24, 2016
Latest reply on Mar 24, 2016 by Stu412

Hi there,

 

I need to create a value list for portal filtering.  The data in the portal is of the format:

 

 

   

          Cust IDAreaValue Date
1010North1000031/10/2014
1010South1000031/10/2014
1010North1000031/10/2013
1010South1000031/10/2013
1010North1000031/10/2012
1010South1000031/10/2012
1015North1000030/09/2015
1015South1000030/09/2015
1015North1000030/09/2014
1015South1000030/09/2014
1015North1000030/09/2013
1015South1000030/09/2013

 

As you can see, there are multiple customers on the data table, so if I create a value list based on the values in 'Year', it'll be massive as it's picking up each record.  Instead I just want the value list to look at each distinct instance for the customer who's record I'm viewing at the moment (and therefore it's only their records in the portal) and return, in this case above, only 3 year's worth:

 

1010  31/10/2014

1010  31/10/2013

1010  31/10/2012

 

 

I've tried an ExecuteSQL Select Distinct and this is waaaaay slow, so it's not viable in my case.

 

Any other help though is greatly appreciated.

Thanks in advance

Outcomes