Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
can someone explain why the record version does not give result in genlist;
let alist = {"a","b","c","c","c","d","d"} ,
lc = List.Count (alist )
in
List.Generate( ()=> [ i = 0 , x = true ] ,
each [i] < List.Count( alist) -1,
each [ i = [i]+1, x = alist{[i]} = alist {[i]+1} ]
)
[ alist = {"a","b","c","c","c","d","d"} , lc = List.Count (alist ) ,
genlist = List.Generate( ()=> [ i = 0 , x = true ] ,
each [i] < lc =1,
each [ i = [i]+1, x = alist{[i]} = alist {[i]+1} ]
) ]as a test I also tried ;
[alist = {1..10} ,
b = List.Transform( alist, (A)=> A * 10 ) ]
and this does allow b to work on alist, so I don't see a problem in principal , any solution / explanation.
Richard.
Solved! Go to Solution.
what's this?
each [i] < lc =1
thanks, had second look as did not get what you meant, should have been i < lc -1 no = ,
problem solved.
it's pretty obviuos if you look at the code. .
each value of i is less than lc
What do you mean by 'Result'. The let statement has an in clause giving a result. The record does not. The record itself is the result.
I suspect you did not give us the full context of the query, so hard to tell what causes any difference.
I mean result the 'in' statement or the gen of record.
Is this what you are looking for?
[ alist = {"a","b","c","c","c","d","d"} ,
lc = List.Count (alist ),
genlist = List.Generate( ()=> [ i = 0 , x = true ] ,
each [i] < List.Count( alist) -1,
each [ i = [i]+1, x = alist{[i]} = alist {[i]+1} ]
) ][genlist]
No I'm looking for an answer as to why the let statement gives a result and the record does not
that was the question asked. .
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |