Cals attributes meaning - xslt

I've been working on cals tables, and i came across some line as below.
<entry colname="col2" align="left" valign="top"><para>Powers of Attorney</para></entry>
Here i'm unable to understand what entry colname="col2" is for and how to render it in my XSLT. please let me know what is the use of this and also please suggest me some CALS Tables XSLT tutorial.
Thanks

The CALS format for tables includes a colspec which defines the columns and (optionally) gives a name to each column. Individual table cells can then specify which columns they appear in using colname (for a single column) or namest/nameend (spanning multiple columns), which cross-reference to the names in the colspec. In the absence of any colname/namest/nameend attributes the columns will lay out from left to right like the td elements in an HTML table, but with name cross references entries may appear out of order.
Furthermore, row-spanning is handled by a cell on one row having morerows="number", so when processing one row you have to keep track of whether there are any cells spanning into this row from the row above, and if so which columns they are in - it's very much an iterative algorithm which is not particularly easy to handle in a declarative language like XSLT.

Please take a look at this website for more info on CALS tables.
http://www.docbook.org/tdg5/en/html/cals.table.html

Related

Workarounds to handle merged table cells in 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.

Power Bi dealing with repeated instruments from REDCap

I have data like this:
It comes from REDCap, and as you may be able to tell, the data in the far right columns are repeated variables about each "protocol_title" (the far left column). I.e. "Love it" and "I want a disc instead" are both about "study 2"
I've imported the data into Power Bi and currently I have this:
What I'd like is for the top left visual to only have one row per study (with columns such as principal investigator and method of image transfer, i.e. columns that had data in the first row) and a visual on the lower left with all the right-most columns.
By switching the top visual from a table to a matrix I can kinda accomplish this:
But it adds a bunch of unnecessary columns. As an alternative I thought I could add a filter to the top visual that would filter to "redcap_event_name"=="protocol_information" which would only be those top rows.... but given the visuals are linked, if I do that it removes everything from the bottom visual. I'd like to keep the link between the visuals so that if I select "study2" in the top visual, it'll highlight relevant study 2 information in the bottom one.
So my question is: what's the best approach for making the visuals I want? Are there special settings for visuals? Do I need to do something to the data first in the query? How should I go about this?
You might want to rework you data structure. At first glance, your flat source table could be parsed into two tables :
Protocol
Survey
This can be done in PowerQuery.
For Protocol :
Select columns A to R.
Filter on redcap_event (?) starts by "protocol_info"
Delete empty rows
For Survey
Select columns A (to keep the protocol ID and be able to link both tables), T and U.
Filter on redcap_event (?) starts by "survey"
Delete empty rows.
You should end up with the two table with a one-to-many relationship between Protocol[Protocol_ID] (column A) and Survey[Protocol_ID] (same)
And it should make everything much easier: visuals, calculations...

How to write regex in Knime Unpivoting node to select columns

I am attempting to unpivot COVID-19 data in Knime with the Unpivoting Node.
The data available from Johns Hopkins at
https://github.com/CSSEGISandData/COVID-19
is wide format where each new day of data is added as a new column.
I can manually make the columns with daily data be rows with the Unpivoting Node. However, each day I must reconfigure the node to account for the new column. There are 5 unpivoting nodes in my workflow where this must be done.
The Unpivoting Node has an option to use Regex to detect the columns to include or exclude but I am unable to make it work.
The available columns to include/exclude are a handful of field names such as Province/State, Country/Region, Lat, Long, plus the long list of date columns of the format m/d/yy (or m/dd/yy if later in the month). The Johns Hopkins data for the US is similar format but with additional columns for counties, iso codes, etc.
All of the date columns are this year (i.e. 2020).
For the top part of the Unpivoting node where Value Columns are
specified, I can do what I need by using the Wildcard setting and the
pattern */*/20
For the bottom part of the Unpivoting node, I need a wildcard or Regex
expression to specify all the other columns.
All the other columns include alphabet characters. None are of the format m/d/yy.
Therefore, some sort of Regex that includes any column with alphabetical column names, or specifies NOT m/d/yy should do the trick.
I tried using [\s\S]+ for help writing the Regex but nothing seems to work. I appreciate any help.
If other column names don't have / you can use [^/]+. Check here for more explanation.
I think it might be easy to select the other columns manually in the Retained columns section. (That way you can easily remove some of them if you want to.) I assume the date columns are in a single group, so you can click on the first column to retain, scroll down to the first date column you do not want to retain, Shift+click on the previous column, include those, scroll to the column after the dates columns, and do similar. Please use the Enforce inclusion option to not generate warnings/errors when the new columns added.
Example:
This way you can later easily remove columns from the retained.
PS: On your screenshot it seems you forgot to include the + from the end of the expression.

M2DOC how to customize Table

I implemented my owned service that returm MTable to insert a table in my doc.
Someone have examples on how to merge cells ?
I would like, for example, a table with 2 columns. The first column composed of only one cell, and the second column composed of 3 cells.
Thanks
For the moment this is not supported by M2Doc.

Grouping by multiple columns and aggregating all values

I am rather new to Power Bi and I have a question i can't find the answer to.
I want to import a table that have some label columns, with repeated items, and more than 15 data columns.
My desire result would be to group the label columns, so no repeated items, and aggregate the values of the remaining columns.
Is there a way to do that in PQ editor or DAX ?
I appreciate any help or direction you can give me!
A sample of the table (it's much bigger, with multiple values in the first three columns)
Table Sample
Thanks a lot
Edit: From that sample, the output y I want is the following
Output Sample
The thing is, there are many different values in the first columns, and i need to agreggate all the other values, keeping they column name (cause this info is already linked to other files).
Maybe the only way is to group by and add the columns, renaming them one by one?
I want to do this in a couple of files, so if you know of another way please let me know!
In your query designer import your table. Then go to Home > Group By and group like you want it, the same goes for the aggregations and thats it.
If you just want to remove row duplicates, just group all columns which you dont want to aggregate and the rest can be aggregated like you want it.