Workarounds to handle merged table cells in M2Doc - m2doc

In my document, I need to generate a table that has merged cells.
simple example
As M2Doc does not support the merge of cells, I have tried two workarounds.
Workaround 1
It consists in creating nested tables inside the second column. I have played with the borders to hide the fact that it is a nested table.
M2Doc template of workaround 1
Unfortunately Word does not handle nested table correctly, as there is no way to garantee the constant width of cells. Which results in columns that don't have a constant width.
illustration of inconsistent column width
Workaround 2
My second workaround was to generate excel tables outside M2Doc, with Python4Capella. And in my M2Doc template, I create references towards the generated tables.
This second workaround would work well if I did not have to display XHTML descriptions in my table. So far, I can only get the markup code in Excel and I have no means to interpret it.
Any idea of how I could implement my table including merged cells with the current capabilities of M2Doc? For example with a dedicated Java service that I would develop? If so, any hint about how this service could be implemented is highly welcome. And so is any idea of strategy!
Thank you

It is possible to create a Java service to merge cells for instance this service.
Also you have Excel services to insert a table from an .xlsx file.
With Python for capella you will have to parse the XHTML from your description to use OpenPyXL formating.
And maybe an other idea could be to use MS Excel itself to do the conversion via a macro or some cell format option.

Related

set Power Query display folder for a query column in M?

I have a number of very wide datasets in Power Query - hundreds of columns each (don't ask). I am trying to determine if (how) to assign columns to display folders programatically. I have access to some data that I could use to assign the display folder based on the column name. Some research into the metadata functions in M is tantalizing but I have not found the silver bullet example yet. Has anyone attempted this?
I've done some basic research and written some bits of M to look at the metadata functions, but that's about it. I was hoping someone might have the magic function call needed to set the display folder, or know if it is even possible.

Is there a way that POWERBI does not agregate all numeric data?

so, I got 3 xlsx full of data already treated, so I pretty much just got to display the data using the graphs. The problem seems to be, that Powerbi aggregates all numeric data (using: count, sum, etc.) In their community they suggest to create new measures, the thing is, in that case I HAVE TO CREATE A LOT OF MEASURES...Also, I tried to convert the data to text and even so, Powerbi counts it!!!
any help, pls?
There are several ways to tackle this:
When you pull a field into the field well for a visualisation, you can click the drop down in the field well and select "Don't summarize"
in the data model, select the column and on the ribbon select "don't summarize" as the summarization option in the Properties group.
The screenshot shows the field well option on the left and the data model options on the right, one for a numeric and one for a text field.
And, yes, you never want to use the implicit measures, i.e. the automatic calculations that Power BI creates. If you want to keep on top of what is being calculated, create your own measures, and yes, there will be many.
Edit: If by "aggregating" you are referring to the fact that text values will be grouped in a table (you don't see any duplicates), then you need to add a column with unique values to the table so all the duplicates of the text values show up. This can be done in the data source by adding an Index column, then using that Index column in the table and setting it to a very narrow with to make it invisible.

In PowerBI,how to split a column when using DirectQuery?

When Using direct query, powerBI is saying that splitting a column is not supported. I have a column and I need to split it into many columns. Do I need to use the import data option or is there a workaround. I am not able to use the import option because my table is very very huge.
This is not supported through direct query. Direct query method has a lot of limitations when it comes to manipulation of the source dataset like you cannot create calculated columns or measures, number formatting etc. With Direct query you basically see the source as it is with very little modification possibilities.

Power Query Formula Language - Detect type of columns

In Power BI, I've got some query tables generated from imported data. All the data comes in as type 'Any', and I'm trying to automatically detect the type of the data in each column.
Some of the queries generate tables with columns based on the in-coming data - I don't know what the columns are going to be until the query runs and sets up the table (data comes from an Azure blob). As I will have quite a few tables to maintain, which columns can change (possibly new columns being added) with any data refresh, it would be unmanageable to go through all of them each time and press 'Detect Data Type' on the columns.
So I'm trying to figure out how I can do a 'Detect Data Type' in the query formula language to attach to the end of the query that generates the table columns. I've tried grabbing the first entry in a column and do Value.Type(column{0}), however this seems to come out as 'Text' for a column which has integers in it. Pressing 'Detect Data Type' does however correctly identifies the type as 'Whole Number'.
Does anyone know how to detect a column's entry types?
P.S. I'm not too worried about a column possibly holding values of different data types
You seem to have multiple issues here. And your solution will be fragile, there's a better way. But let's first deal with column type detection. Power Query uses the 'any' data type as it's go to data type. You can write a function that samples the rows of a column in a table does a best match data type detection then explicitly sets the data type of the column. This is probably messy and tricky since you need to do it once per column. This might be workable for a fixed schema but for a dynamic schema you'll run into a couple of things very quickly. First you'll need to write some crazy PQ code to list all the columns and run you function on each. This will work the first time, but might break in subsequent refreshes because data model changes are not allowed during refresh. If you're using a tool like Power BI Desktop, you'll be able to fix things up. If you publish your report to the Power BI service, you'll just see refresh errors.
Dynamic Schemas will suffer the same data model change issue I mentioned above.
The alternate solution that you won't have problems with is using a Direct Query data source instead of using Power Query. If you load your data into Azure SQL or a Tabular Model, the reporting layer will get the updated fields automatically so you don't have to try to work around using PQ.

How to update OpenOffice Calc sheets with new formulas and formats?

I have created a spreadsheet in OpenOffice Calc that has multiple sheets for each month of the year. The sheet has some specific formulas and data laid out in several months.
Is there any easy way to go about modifying a formula and having it transfer across all the sheets?
Or if the format changes, is there a way to merge sheets through some type of macro or something?
If your data is laid out in a very regular way, you may be able to copy+paste the modified formula to each sheet and have it adjust the cell references correctly.
However, for this type of flexibility (being able to make a change in one location and have it reflected in how all existing data is displayed) a database is generally required. OpenOffice has a database component Base, and information from Base can easily be imported to Calc if you have specific spreadsheet requirements. The learning curve for Base is fairly long, but might be worthwhile if you handle this kind of data frequently.
A formula in the same place on several sheets need only be updated once provided the relevant sheets are grouped together first (click their tabs with Ctrl depressed - and don't forget to ungroup them when appropriate!). Fill applied to A1 of a group of sheets will colour A1 in each of those sheets.
The Consolidate feature (under Data) might be of interest.