Hi TB Team,
I'll go straight to the point:
I have two ordered lists which indexes and count perfectly match. One has my future headers, the other has my future values
Using the list comprehension formula provided in docs here (Ordered in and Keyed Out), I can turn them into keyed lists, each. No problem.
I need to combine them tho so I use a formula like this:
{=[headers[index]:x for (x, index) in values]}
It works fine and the pairings respect the INITIAL indexes of their respective lists...but somehow, the displayed order of keys completely change. Text Blaze seems bent on putting the numerical keys first and in ascending order. Without me asking anything. The arbitrary order of the "string" keys seems to be maintained and respected.
The two ordered lists we initially have:
Ordered List "headers": {formtext: name=headers; default=["Category", "2014", "2015", "2013", "a", "b", "Total"]}
Headers list keyed out by its index:
{=[index: x for (x, index) in headers]}
Ordered List "values": {formtext: name=Values; default=["Revenue", "39.753", "42.612", "45.272", "lorem", "ipsum", "127637"]}
Values list keyed out by its index:
{=[index: x for (x, index) in values]}
"Values" list keyed out by "Headers" items, see how key's order is not respected:
{=[headers[index]:x for (x, index) in values]}
Map() version:
{=map(values, (x,index) -> headers[index]:x)}
What is happening and why is it doing this ?
I need the final keyed list output to stay exactly in the order I provided, how can I proceed, pls ?
Didn't find a turn off switch, a parameter to settle or a workaround (like a function that would for it to consider any values as a string).
Also thought of using the map() function instead but it doesn't seem to accept this kind of complex input and throw back an error message at the dashboard level (won't let me close the formula).
The "pairings" between the two lists are never wrong so the issue seems to happen after the computing is done but before displaying the results.