Forum Discussion
Dicken
2 years agoPost Prodigy
Inserting blank into a list ,
Hi, in the code below is there a way to deal with the fact the last value is not included, other than what i have don and let alist = { "a","a","a","a","b","b","b","b","c","c","c","d"} , ...
- 2 years ago
Please read post alist =
{ "a","a","a","a","b","b","b","b","c","c","c","d"} - 2 years ago
This perhaps?:
let alist = {"a","a","a","a","b","b","b","b","c","c","c","d"}, poslist = {1..List.Count(alist)-1} in List.Accumulate(poslist, {alist{0}}, (s,c)=> if alist{c} = alist{c-1} then s & {alist{c}} else s & {"",alist{c}})resulting in:
or use null instead of "".
AntrikshSharma
2 years agoCommunity Champion
Dicken What is it that you're trying to achieve here? Add a blank row before each new alphabet?
- Dicken2 years agoPost Prodigy
No I , that is what it does, I want a better solution to getting the last value included ohter than just adding it on the end, I did say this in the originla post, please don't suggest alternativves as that is not the point I wans a conditons that will autmatically include the last value when ii is met or something somilar.