Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
shift columns
Ireth
Can someone please explain to me, how do exactly "shiftColumn(int srcCol, int destCol)" work?
I have read, that when the destColumn is 0, the srcColumn is placed on the first place, and when the destColumn is greater than the column’s count, the srcColumn is placed on the last place.
But that doesn’t work as explained. I’m very confused about that.
Also the result is different every time.
I need it, because I want to swap two column’s places at runtime.
There is my example:
ReportDesignHandle dh = .....
TableHandle th = (TableHandle) dh.findElement("myTable");
th.shiftColumn(sourceColumn, destColumn);
My table looks like:
col1 | col2 | col3
I want to swap the places of col1 and col3., because the desired order is:
col3 | col2| col1
In this case I have:
th.shiftColumn(1, 3);
The result is:
col2 | col3 | col1
Then I should shift again:
th.shiftColumn(2, 0);
So the result should be:
col3 | col2| col1
But that’s not the case, at least not every time.
Also this must have the ability to be repeated many times.
Find more posts tagged with
Comments
mwilliams
Hi Ireth,
Can you post the link to where you found this information on this function? Have you tried just shifting the 2nd column to the end and then the first column to the end?
th.shiftColumn(2,3);
th.shiftColumn(1,3);