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 "".
Dicken
2 years agoPost Prodigy
No I'm tryiing to achieve what I said I was trying to achieve, a way of avoiding just adding the last value on
at then end.
s & { alist {c} , "original post.