Copying a tab from one PAW book to another

Ever had the situation where you need to merge books or move a tab from one book to another?

I have needed to do this on occasion and have ended up inserting a blank tab then recreating my content from scratch.

This obviously takes time and introduces risk as you can easily forget about things like conditional formatting or other subtle features you may have applied.

Today I had a requirement to merge a book with another and wanted my tab copied and incorporated with my main master data book that is used to manage Materials.

The basic steps are the following:

  • Identify the source tab’s content you want to copy over and copy this to your clipboard
  • Open the board specification for the target book and locate the insertion point then paste the content
  • Update and close the board specification then drag the tab to the desired location and save your book.

 

Step 1 – Copy the source tab specification

Access the source book and put it into edit mode using Ctrl + Q + / (on a windows QWERTY keyboard)

The board specification should open detailing the configuration of the book and each of its tabs.

The specification will look something like mine below:

If we paste the full board specification into a JSON viewer like http://jsonviewer.stack.hu/ , we see the following:

The layout section has an items array containing the tabs. In my case, only the one tab, item 0

From the previous snippets, you can see that I highlighted from the start of this item, the first open brace, to the end, the closing brace before the closing square bracket for the items array.

I then copied the specification selection to my clipboard.

 

Step 2 – Open target book board specification

Access the target book and put it into edit mode using Ctrl + Q + / (on a windows QWERTY keyboard)

The board specification should open detailing the configuration of the book and each of its tabs, just like with the source book.

If you copy the board specification (Ctrl + Q + / on windows QWERTY) to a JSON viewer, you get something like this, just like the source book:

My target book has 5 tabs, per the items array in the above numbered from 0 to 4.

Essentially we want to insert the code from our source tab after item 4 above. Inserting at the end, after the last tab, is just easier when locating the insertion point.

The insertion point would then be within the items array (container), before the end of the layout section and the overall JSON.

Per the below graphic, we would be expecting a close square bracket to close of the items array then a close brace to close off the layout and the final close brace to close off the JSON.

Changing our MDX, I would like to see High as above 500,000, Medium above 300,000 and everything else as Low. Additionally, Total Products is probably not relevant here so will set this to blank. I have also ordered my logic from High to Low so that the first matching case is applied.

Step 3 – Update board specification and save

So now we know where we want to insert our source tab code i.e. after the last tab and before the close square brackets, we can start by adding a comma after the current last tabs close brace then paste our source tab from the clipboard.

After pasting, update the board specification and assuming you found the correct location to paste into, added the comma etc., you should see your source tab inserted at the end of your book.

From here, you can move it to where you want it using drag and drop in PAW.

You obviously want to do this on a copy of the target book in case you mangle something. You can also use the reset book icon in PAW if you break something but still risky in case you save over the book.

Hope this save you some time and effort. Would like to hear any feedback on this. Let me know if there are any errors or amendments needed to make this article more useful.

Note: There is an Idea captured for doing this natively in PAW but until this is implemented, the above may be a reasonable workaround.

https://ibm-data-and-ai.ideas.ibm.com/ideas/PAOC-I-910