Well, I apologize if the topic title is not correct, but English is not my native language.
I’m asking for help to convert the dataset from the table1 to another dataset (table2) that can be used in the bar chart (I think it’s called ‘Grouped’ dataset).
And that should be done in the python (Jython) script in the Data property change event of the table1.
That is called a PIVOT. Your task is easily accomplished by the view() function from my (free!) Simulation Aids module. You would use an expression binding on data on table #2 like so:
view("Select Date Pivot Pieces For 'Shift '+str(Shift) Order By Date",
{Root Container.Table 1.data})
No input for a combination yields a null output. You could explicitly include a zero in the sum expression, like so:
view("Select datum Group By datum Pivot sum(stevilo_kosov+[0]) For 'Shift '+str(izmena) Order By datum",
{Root Container.Table.data})
{ Edit: the above doesn’t work because the sum doesn’t even execute for missing group/pivot combinations. }
Inside the Pivot, stevilo_kosov is a python list. If you turn on the debugger mentioned in the doc, your diagnostic console will get a copy of the jython written by the view() function to solve your problem.
Could you describe exactly what you need to achieve ? Maybe give an example input and output.
A basic pivot is relatively easy to do, but depending on the use case there might be little twists to add to the process.
You should ask permission. I create modules for functions/features that are difficult or impossible to do otherwise. I made Simulation Aids free to make its use as easy as possible, by anyone. I install it on every gateway I work on. That it won't load on Edge is one of the reasons I don't use Edge.