Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
My task is to set a customized load order.
Let's say there's a field 'Brands', and there are 5 different brands in this field.
My task is to set the following load order:
Brand 5, Brand 3, Brand 1, Brand 2, Brand 4.
How should I change this script in order to solve my task?
table1:
LOAD Brands,
FROM
C:\Users\Larisa.Filonova\Desktop\brand_data2.xlsx
(ooxml, embedded labels, table is data)
Thank you in advance,
Larisa
What you can do, before you load the main table is to create a load inline table in the script, or even an external xls file that you'll load before the main table.
The values of this table will determine the sorting of the table.
e.g.
If you use the following:
Test:
Load * Inline [
Brands
Brand 5
Brand 3
Brand 1
Brand 2
Brand 4
];
It will create a table with the above values, so later on, when you load the main table with the actual Brands field, as long as you select the Load Order option from the Sort tab on the object properties, the table will maintain these five values first.
Try it and let me know.
Don't forget to DROP the Test table AFTER you load the main table.
Thanks
Agis
May be this will help:
table1:
LOAD Brands,
FROM
C:\Users\Larisa.Filonova\Desktop\brand_data2.xlsx
(ooxml, embedded labels, table is data)
Order By Match(Brands, 'Brand5', 'Brand 3', 'Brand 1', 'Brand 2', 'Brand 4');
Update: Just checked, Match won't work
Best,
Sunny
What you can do, before you load the main table is to create a load inline table in the script, or even an external xls file that you'll load before the main table.
The values of this table will determine the sorting of the table.
e.g.
If you use the following:
Test:
Load * Inline [
Brands
Brand 5
Brand 3
Brand 1
Brand 2
Brand 4
];
It will create a table with the above values, so later on, when you load the main table with the actual Brands field, as long as you select the Load Order option from the Sort tab on the object properties, the table will maintain these five values first.
Try it and let me know.
Don't forget to DROP the Test table AFTER you load the main table.
Thanks
Agis
hi
try spmething like this :
order:
LOAD * INLINE [
Brands, F2
'brand 1', 1
'brand 2', 2
'brand 3', 3
'brand 4', 4
'brand 5', 5
'brand 6', 6
];
let S= 'Brand 5, Brand 3, Brand 1, Brand 2, Brand 4';
for i=1 to 5
table1:
LOAD Brands,
f2
resident order
where Brands=text(subfield($(S), ',' ,$(i)));
drop table order;
Hi,
Would sorting field values using this approach have any influence on the colors that are being assigned automatically to field values during data reload?
Long story short, I have this field Product:
Coloring of bar chart is done automatically (or by drop-down dimension, both are giving the same result) - which means that colors on the chart are those that were assigned to field values during data reload.
And these 'automatically assigned' colors keep switching between values randomly upon each reload - the same 3 needed colors, differently assigned.
SO the final question is - (why are the colors switching and) would sorting them like you explained in the solution fix this issue?
Thanks a lot!
It does solve the problem!!! 😄