Jump to content

Wikipedia:Reference desk/Archives/Computing/2021 September 10

From Wikipedia, the free encyclopedia
Computing desk
< September 9 << Aug | September | Oct >> September 11 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 10

[edit]

Facing an issue in Bing Webmaster

[edit]

I am trying to index my website pages on Bing but the Bing URL inspection shows that the H1 tag is missing and description is too long in Homepage. While In Google Search Console, it has no error. Can anyone help me in this case?

The missing H1 might be a bug in Bing Webmaster tools on which you might want to report ; if Bing recognizes the description as too long it might be because of the current way Bing works.

24 hours a day

[edit]

I've got a database query (Oracle SQL) that pulls in and summarizes particular transactions by date and hour. The end goal is to take this data and heat map it so people can find times of day throughout a week where their functions are possibly under or over-utilized. What comes back is a dataset that looks kind of like this: date (simple calendar date), hour (2-digit value from 00 to 23, and then various summaries: number of users, number of transactions, etc. It works fine and is accurate. I then pivot this to make it easier for people to select a function or DC or whatever and I've heat-mapped the pivot table appropriately. Hours as the rows, days as the columns. This also works, but there's a drawback.
The drawback is this: depending on the filters selected, the pivot may not show all 24 hours of the day, potentially making is confusing or difficult to read. Work that wasn't contiguous may appear to have been. It's no mystery: if there are no transactions in a particular hour, nothing comes back in the data set, so nothing shows up in the pivot table. What I'd like to do is force the pivot table to always display 24 hours. I thought the simplest way was to construct the pivot table as a "data model", link the transactions to a simple table with the 24-hours, and then use the 24-hour table as the base for my pivoted rows. But it doesn't work like that; it can be done, but only if I add some other value from that table to the values portion of the pivot. In Excel 2016 at least, the tables joined are always like SQL inner joins while I want the equivalent of a left outer join.
Assuming I'm not missing something with Excel's pivot tables, my only option is to do something with the SQL. I assume that'll bloat the data pull a bit, but I can't think of other options. So, how could I do it? I can't add a table to my database (I don't have the authority), but I assume there's some way within the SQL itself to say "here are 24 values and left outer join them to the hours field of the main query". I've farted around with various WITH statements before, but I don't know how to format something like this. Here's a simplified version to get a sense of layout:

SELECT

TRUNC(TRX.CREATED_DATE) as TRX_DATE,

SUBSTR(TRX.CREATED_DATE,12,2) as TRX_HOUR,

COUNT(TRX.UNIQUE_KEY) as TRX_CNT,

SUM(TRX.TRX_UNITS/TRX.PACK) as CASE_QTY

FROM WM_TRX_VW TRX

WHERE <blah>

GROUP BY <blah2>
Any help would be appreciated. Attempts to Google lead me to tutorials about left outer joins, but maybe I'm just using the wrong expressions. Matt Deres (talk) 18:04, 10 September 2021 (UTC)[reply]

I assume that "to pivot the data" means, "to transform the data by aggregating like items" (not a usual meaning of the verb). I don't understand how this is this supposed to make it easier for people to select a function or whatever. What if you just skip this?  --Lambiam 11:14, 11 September 2021 (UTC)[reply]
"Pivot" refers to pivot table, which is a table where the data has been, um, pivoted. First sense of the Wiktionary link you gave. Matt Deres (talk) 20:56, 12 September 2021 (UTC)[reply]
The first sense given is intransitive and so cannot be used in the passive voice. Rewritten to the active voice, as in "the data has been made to pivot", the sentence tells us that the data has made a non-linear physical movement on an exact spot. Interesting.  --Lambiam 13:17, 13 September 2021 (UTC)[reply]
Are you unfamiliar with pivot tables? Although they are often used to merely summarize data, they can - and in this case do - literally turn the data so that stuff represented vertically in the source data is twisted and presented horizontally (and then summarized). Usage gets complicated because Microsoft claimed trademark on the word (since abandoned) so that you could also use "pivot" in the sense of "summarized with Microsoft Pivot Table function" without the data actually being pivoted at all. Matt Deres (talk) 13:33, 13 September 2021 (UTC)[reply]
In Excel you might try creating a blank sheet but with all the possible dates and hours on it, and then use a LOOKUP function in the body of the "table" that finds the relevant date and time entry. You would (IIRC) get N/A where these don't exist but you could either live with that or make another table in Excel where you use an IF function to convert N/A to zero.--Phil Holmes (talk) 11:36, 11 September 2021 (UTC)[reply]
Hmm... That's an option for sure - and one that I hadn't thought of. It's not my first choice, since it would severely limit my ability to make the file updateable/refreshable and also require a bunch more computing (doing the SUMIFs/COUNTIFs/VLOOKUPs/etc.), but it's at least an option - thank you! That'll be my backup plan if nothing else. Matt Deres (talk) 20:56, 12 September 2021 (UTC)[reply]