Benjamin S Posted December 13, 2022 Share Posted December 13, 2022 Hello!I want to create a simple Pie-Chart from the last row in a table. The table exemplary looks like this:The desired chart shall look like this: I need the table to be in this format in tibco, so transposing it for this pie chart would require loading the data twice. Isn't there a simple to create a custom expression for the color property like in this dummy code:Array(Last([A]),Last()) ?Or is there any other way to achieve this?Thanks a lot! Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted December 14, 2022 Share Posted December 14, 2022 Hello,The pie chart is column-based for for this use case, creating an additional data table based on the first one and transposing it, would be a good option. Is there a particular reason you want to avoid that? Note that you could e.g. put only that single last row of data in the new table, by using a "Filter Rows" transformation (I used DenseRank([Date],"desc")=1 to get the last Date/row in my example below) . See example below where I created Data Table(2) based on the original data from Data Table 1, using a Filter Rows and Unpivot transformation to reformat it, which I then used in the pie chart. Link to comment Share on other sites More sharing options...
Benjamin S Posted December 14, 2022 Author Share Posted December 14, 2022 Hello @Fredrik Rosell !Thank you very much for your fast response.Adding in an additional data source (so in theory a duplicate of the history data source, just pivoting it) seems like an overkill to just get two values for me. It might affect loading times since it has to load the same table twice, if I am correct. This is why I would like to avoid it.I was also wondering if I could add in an additional column as follows:If([Column1]=Min([Column1]),Last([A]) ,If([Column1]=Max([Column1]),First([A]),Null))By this I would like to have an column which contains only two values, the rest would be empty. This should be a valid input for the pie chart. However, Last([A]) and First([A]) are not working since they are row-related and not considering the entire column :/ I also tried Min([A]) Over [Column1] but it also seems that this is only considering the [A] value from that row. Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted December 14, 2022 Share Posted December 14, 2022 Hello Benjamin!>It might affect loading times since it has to load the same table twice, if I am correct. This is why I would like to avoid it.Note that in my example, it only loads the data once - the new table is based on the existing one, using (one row of) data from that. Link to comment Share on other sites More sharing options...
Benjamin S Posted December 14, 2022 Author Share Posted December 14, 2022 Ah Okay, well that sounds reasonable thought. Maybe I missed that possibility in the courses, I am still an amateur here.I am currently reading the data via "+" -> "Browse local file" -> Select excel file.This shows the data connection between excel file and tibco data table.How can I create another branch from this .xlsx file to a second data table? Or is Tibco automatically realizing that two datatables are based on the same source and then only loading once?Or is IronPython'ing required? Link to comment Share on other sites More sharing options...
Solution Fredrik Rosell Posted December 14, 2022 Solution Share Posted December 14, 2022 When you go to add data under +, under Other, you can find the existing data tables under "Linked copy to data table in analysis". Just select one of those to base your new data table on an existing one. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now