Wikipedia:Reference desk/Archives/Computing/2019 August 12

= August 12 =

Excel queries and pivot tables
I frequently write queries to our database by way of the MS query function in Excel. When I've done my thing and am ready to bring the data back, I'm given three main options: to dump the result into a table, into a PivotTable, or into a PivotChart. I usually use one of the first two, depending on what I want to do next. At the bottom of the dialog box is the option to import the data into the Data Model version of a pivot table, but it's greyed out, which is the problem. Searching online finds people with a similar situation, but they are in relation to creating a Pivot Table from an existing table, while I am coming at the problem from a different source. Any thoughts as to why the option is greyed out for me and how I can get around this? Perhaps alternatively, is there any way to convert a "normal" pivot table into a Data Model one after said PT is in existence? Searching online finds this unanswered question on Mr Excel from two years ago. Matt Deres (talk) 15:23, 12 August 2019 (UTC)

jQuery interpreting widths wrongly
I've encountered a strange problem at work. The code uses jQuery to interpret the widths of elements and set child elements styles accordingly.

The problem is, jQuery interprets the widths wrongly. No matter what the actual widths are, the jQuery function  always returns 100. This happens even if I only call the function from within  and.

What is strange here is that the jQuery code works perfectly OK for elements written directly on the page. But it fails on elements that are only rendered via an  call, even though the actual jQuery code is still within   and.

Why is this happening? Could it be because the jQuery code is executed before ? J I P &#124; Talk 23:10, 12 August 2019 (UTC)


 * One thought is that it's returning the allocated length rather than the actual length. I have no idea why, however. SinisterLefty (talk) 02:49, 13 August 2019 (UTC)


 * It's hard to diagnose this without seeing it in action: can you make a small example that shows the behaviour and put it on CodePen or JSFiddle? AndrewWTaylor (talk) 06:26, 13 August 2019 (UTC)


 * I found out what was causing this. The elements that jQuery was failing at were inside a  that had a CSS class causing an animation lasting 0.15 seconds. That was apparently enough time for   and   to fire before the elements had been fully rendered, causing jQuery to fail to find their exact widths. When I took the CSS class away the code started working.  J I P  &#124; Talk 14:57, 13 August 2019 (UTC)


 * Glad you found it. SinisterLefty (talk) 15:23, 13 August 2019 (UTC)

SinisterLefty (talk) 15:23, 13 August 2019 (UTC)