Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to modify a crosstab column based on other columns
TimSchuster
<p>I try to solve the following problem. </p>
<p> </p>
<p>I've got a table for a server landscape in which server attributes like cpu and memory are specified. On a daily basis the server attribute table is snapshoted and stored in a snapshot table like below. </p>
<p> </p>
<p><b>snapshot</b> <b>server</b> <b>field</b> <b>value</b></p>
<p>01 server1 cpu 1</p>
<p>01 server1 mem 8</p>
<p>02 server1 cpu 2</p>
<p>02 server1 mem 12</p>
<p>03 server1 cpu 2</p>
<p>03 server1 mem 12</p>
<p>01 server2 cpu 1</p>
<p>01 server2 mem 8</p>
<p>02 server2 cpu 1</p>
<p>02 server2 mem 0</p>
<p>03 server2 cpu 1</p>
<p>03 server2 mem 8</p>
<p> </p>
<p> </p>
<p>Now I would like to create a crosstab which shows the attributes along the time (each column 01, 02, .. are daily snapshots).</p>
<p> </p>
<p>Now I would like to achieve two things:</p>
<p> </p>
<p>a) the changed values (compared to the previous snapshot) should be colored (colored in green) in order to catch them up visually quickly. This I have already resolved with the help of onCreate event.</p>
<p> </p>
<p> <strong><span style="font-family:arial;">snapshot </span></strong> <strong><span style="font-family:arial;">01</span></strong> <strong><span style="font-family:arial;">02</span></strong> <strong><span style="font-family:arial;">03</span></strong></p>
<p><strong><span style="font-family:arial;">server</span></strong> <strong><span style="font-family:arial;">changes</span></strong> <strong><span style="font-family:arial;">field</span></strong> </p>
<p>s<span style="font-family:arial;">erver1</span> <span style="color:#ff0000;">true</span> <span style="font-family:arial;">cpu</span> <span style="font-family:arial;">1</span> <strong><span style="color:#008000;"><span style="font-family:arial;">2</span></span></strong> <span style="font-family:arial;">2</span></p>
<p><span style="color:#ff0000;"> true</span> <span style="font-family:arial;">mem</span> <span style="font-family:arial;">8</span> <span style="color:#008000;"><strong><span style="font-family:arial;">12</span></strong></span> <span style="font-family:arial;">12</span></p>
<p><span style="font-family:arial;">server2</span> <span style="color:#ff0000;">false</span> <span style="font-family:arial;">cpu</span> <span style="font-family:arial;">1</span> <span style="font-family:arial;">1</span> <span style="font-family:arial;">1</span></p>
<p><span style="color:#ff0000;"> true</span> <span style="font-family:arial;">mem</span> <span style="font-family:arial;">8</span> <span style="color:#008000;"><strong><span style="font-family:arial;">0</span></strong></span> <span style="color:#008000;"><strong><span style="font-family:arial;">8</span></strong></span></p>
<p> </p>
<p>And now the problem. Additionally to a) I would like to calculate the column "changes" (colored in red). If there are changes from snapshot to snapshot, then column "changes" should contain "true". </p>
<p>This is needed because an excel output should be filterable because the table in reality can be quite large and the filter function can reduce the table to only the changes. </p>
<p> </p>
<p>Please see the attached working (regarding a), b.) is missing) report and csv (datasource). </p>
<p>I tried to find a solution for b.) the last two days but I wasn't successful.</p>
<p> </p>
<p>Maybe you have an idea how to achieve this?</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Here's one way of doing this:</p>
<p> </p>
<p>1. Create a new Table before your crosstab based on your existing dataset.</p>
<p> </p>
<p>2. In the new Table, create a new data binding which is the concatenation of fields Server and Field, as shown here:</p>
<p>
TimSchuster
<p>Hi Pierre,</p>
<p> </p>
<p>thanks a lot. Your solution helped me very much. I do now understand much better how to deal with crosstabs. </p>
<p> </p>
<p>Btw: I did just a slightly modification on your soltution. The approach with the grid for "field" and "change" doesn't create separate columns if exported to excel. Therefore I created a new field in the data (csv) table and handle it according to your solution.</p>
<p> </p>
<p>Thank you for your efforts.</p>
<p> </p>
<p>Tim</p>
<p> </p>
<p> </p>