Supress/remove repeated values in Jdeveloper/ADF Table column - oracle-adf

I need to supress the repeated values in a table so it will look like:
x y z
- - u
- b z
- - u
y y z
- - u
instead:
x y z
x y u
x b z
x b u
y y z
y y u
In Oracle OBI I can do that editing column properties of a table:
But I can't find this option in column/table properties from Jdeveloper, there is a way to do this?

You can't do this in a table.
You can use a pivot table to do this.
Or you can use an af:iterator to create this type of UI.

Related

How to get character like go down stairs in Google Sheets

I want to get a character from string but the path is like going downstairs in Google Sheets
The string is like:
y C I 6 8 V 5
~5 Z n I L w f
V ~s i w J d _
o R ~4 2 i v f
9 ^ j ~h r u #
Z y Q 7 ~1 u a
T t z u _ ~! Q
G Y n r * t ~^
J A l v F j d
a 2 l - y O B
h B w % n a 4
M t _ P D W a
And expect the output is:
5 s 4 h 1 ! ^
I put ~ in front of the character that demo the path I want to get.
The logic is I will find the first column which cell is 5 and then get start from that cell.
Example sheet link
https://docs.google.com/spreadsheets/d/1UQEGEl_rqAMFePDAGoueTI47xF8T_DyrvJ3de5pkLRA/edit#gid=306981885
I tried auto-fill but it could only incrementally either row or column. And I hope to incremental both row and column.
={INDIRECT("A"&MATCH(5, A1:A14, 0)),
INDIRECT("B"&MATCH(5, A1:A14, 0)+1),
INDIRECT("C"&MATCH(5, A1:A14, 0)+2),
INDIRECT("D"&MATCH(5, A1:A14, 0)+3),
INDIRECT("E"&MATCH(5, A1:A14, 0)+4),
INDIRECT("F"&MATCH(5, A1:A14, 0)+5),
INDIRECT("G"&MATCH(5, A1:A14, 0)+6)}
for a large scale scenario you can use this one and drag it to the right:
=INDIRECT(ADDRESS(MATCH(5, $A1:$A14, 0)+COLUMN()-1, COLUMN(), 4))
You can also do it with an array formula if you want to:
=ArrayFormula(hlookup(column(A2:G13),{column(A2:G13);A2:G13},match(5,A2:A13,0)+column(A2:G13)))

How does half of the dimension give the number of layers of NxN matrix?

Assume a matrix of dimension N*N
It seems that to figure out the layers it is composed of the number of them is N/2 but although I can verify it, somehow I can not conceptually connect how does the half of the N gives this layer number.
Example:
4x4 => 4/2 = 2 layers
x x x x
x x x x
x x x x
x x x x
layers:
x x x x
x x x x
x x x x
x x x x
Can someone help me unblock on this?
For even N
Focus on a middle row of the matrix. The layers in the following example (N=6) are denoted with x, y, and z for clarity.
x x x x x x
x y y y y x
x y z z y x <- For example, this row
x y z z y x
x y y y y x
x x x x x x
Because you're in the middle, you will go through every layer. In fact, you'll "enter" every layer once and "exit" that layer later. Each time you enter or exit a layer, there is one element of the matrix. For instance, in the above example, going from left to right we have:
x: enter layer x
y: enter layer y
z: enter layer z
z: exit layer z
y: exit layer y
x: exit layer x
As you can see, we traversed N elements on the row, and each layer needs to be entered and exited, so we deduce that there are N/2 layers.
For odd N
If N is odd, the reasoning is mostly the same, except that the innermost layer (which is just one element) is "entered" and "exited" at the same time. The number of layers is (N+1)/2. We can derive this by temporarily ignoring the innermost layer. The number of elements in the row (ignoring the innermost layer) is N-1, we divide by 2 to get the number of layers (ignoring the innermost layer), and we add 1 (to account for the innermost layer). Then (N-1)/2 + 1 = (N+1)/2.

Is there a name for this type of jagged array?

I'm working with a jagged array representing a hexagon:
x x x
x x x x
x x x x x
x x x x
x x x
or:
xxx
xxxx
xxxxx
xxxx
xxx
I was wondering if this has a name that would help for looking up relevant algorithms etc.

Unwrapping a toroid into 2D space using only point neighbours

I'm trying to come up with an algorithm that can unwrap a toroid into a 2D array so I can address the various points using X, Y coordinates and walk over the mesh in a consistent manner.
My problem is that I don't have a whole lot of information to work with. I've got a list of uniquely identified points that make up the toroid, but the integer identifiers are randomized and non-contigous. I've got a list of neighbours associated with each point, but that list is an unordered set.
Somehow, I need to pick a starting point (presumably the point with the lowest identifier integer), then iterate over the entire mesh in such a way that I land up with a 2D array that describes the identifiers of each point as they're laid out across the toroid surface.
How would I best go about solving something like this?
If you have 2D toroid and you want to put him into 2D array with "neighbours" data, you can do this by this metod.
Toroid is symmetric, therefore you can take any point you want first and put him anywhere into array. I will put it into middle of array, but you can even start in corner, it does not matter.
For 5 x 5 toroid you create 5 x 5 array
X - X - X - X - X
X - X - X - X - X
X - X - X - X - X
X - X - X - X - X
X - X - X - X - X
You take one from your list and put him into middle
X - X - X - X - X
X - X - X - X - X
X - X - O - X - X
X - X - X - X - X
X - X - X - X - X
Now you want to find these neighbours N identified by neighbour of neighbour F. It is quite easy :
Find all neighbours of O
Create pairs between them
If pair of nodes have two same neighbours, remember them. The one of them is O (the first one) the second is new one F.
The first pair which fulfilled conditions :
X - X - X - X - X
X - X - N - F - X
X - X - O - N - X
X - X - X - X - X
X - X - X - X - X
You can get 4 pairs (at each direction), but because of symmetric structure, you can just take one and put it to that array
X - X - X - X - X
X - X - O - O - X
X - X - O - O - X
X - X - X - X - X
X - X - X - X - X
Now you have finally positioned the toroid to something and you can start filling it with values.
Look to these "N" nodes
X - X - X - X - X
X - X - O - O - X
X - X - O - O - X
X - X - N - N - X
X - X - X - X - X
Only two exact nodes fulfill these conditions. You already have "O" nodes in array, therefore you know their position. If I mark the important ones (in this step) as 1 and 2, it looks like this
X - X - X - X - X
X - X - O - O - X
X - X - 1 - 2 - X
X - X - N - N - X
X - X - X - X - X
And only two unrevealed nodes fulfill this : "N1 is connected to 1; N2 is connected to 2; N1 and N2 are connected". Therefore you find them and put them in.
X - X - X - X - X
X - X - O - O - X
X - X - O - O - X
X - X - O - O - X
X - X - X - X - X
You can finish whole line with this approach
X - X - O - O - X
X - X - O - O - X
X - X - O - O - X
X - X - O - O - X
X - X - O - O - X
And now you can do the same to the other direction
X - X - O - O - X
O - O - O - O - O
O - O - O - O - O
X - X - O - O - X
X - X - O - O - X
And then another one
X - X - O - O - X
O - O - O - O - O
O - O - O - O - O
O - O - O - O - O
O - O - O - O - O
And last
O - O - O - O - O
O - O - O - O - O
O - O - O - O - O
O - O - O - O - O
O - O - O - O - O

tsql conditional maths equation

I need to perform some summations during a select query however depending on 2 values i will need to perform a different equation. hopefully an example will demonstrate
basically i need to perform the following summations
if x > y then (x - y + z) or
if x < y then (x - x + z) basically i am setting this to 0.
So far i thought that i could use 2 tables to dump the x > y values and the x < y values and then perform the relevant equations.
any ideas
You can use a case expression.
select case
when x > y then x - y + z
when x < y then x - x + z
else 0 -- x = y
end
from YourTable

Resources