Views table columns not sortable

Standard drupal field types like Strings, Numbers, Dates and Taxonomies can be defined as Sortable in Views with Format: Table.

But more complex fields like Hierachical Taxonomies and Paragraphs or paragraphs don’t have a checkbox to make them Sortable.

Is there any way to make them sortable using Views interface or do I have to make a custom plugin Tablesort with EntityQuery?

Google Sheets SUM columns from other sheets and group by month, but also show the individual sheets values before doing SUM

Currently I have a Spreadsheet which has a number of customer sheets, each with a pivot table showing the month in row I and the total income for each month in row L.

On a separate sheet I have a query that sums all of the month totals (This just shows 2 Customer sheets, normally these sheets are given the name of the customer):

=query({'Sheet1'!I2:I,'Sheet1'!L2:L;'Sheet2'!I2:I,'Sheet2'!L2:L},"Select Col1, sum(Col2) group by Col1 label Col1 'Month'") 

Currently this shows:

| Month       | sum   |    | 2018/12     | £ 35.00  | 2019/01     | £ 155.00  | 2019/02     | £ 60.00  | 2019/03     | £ 210.00  | Grand Total | £ 460.00  

I have been asked to add a column for each customer sheet which shows the value the query took before it did the SUM, I want each column to be named as the Sheet the column came from. So it should look like:

| Month       | sum       | Sheet1  | Sheet2 |    | 2018/12     | £ 35.00   | £10     | £25 | 2019/01     | £ 155.00  | £100    | £55 | 2019/02     | £ 60.00   | £30     | £30 | 2019/03     | £ 210.00  | £110    | £100 | Grand Total | £ 460.00  

If the totals showed under each sheet name it wouldn’t hurt, but isn’t necessary. The sum could be on the left or right, I’m not worried about it’s positioning.

Is there any way to do this in Google Sheets? I have been playing around with query a bit, but haven’t managed to get it to display more than 2 Columns.

Using OFFSET to skip columns with a certain header | Google Sheets

So this is a tad more complicated than the title suggests so try to follow along. My Sheet On this sheet, I’m trying to get cells D4:G4 to show the most recent 4 weeks with data on my spreadsheet. My formula below has a few things going on. First, it counts all of the non blank cells in row 14 from L14:BV14. Second, it uses the OFFSET() function to go to the corresponding header in the date row 2. Third, it checks to see if it is a valid date or if it equals Total. Forth, if it doesn’t equal “Total” , it returns that date. This is where I am struggling. If not, it -1 within the OFFSET() function and displays that date. The issue is depending on where the data lies, it either needs to +1 OR -1. Because it can’t distinguish this, two of the cells will display the same date if one of them lies on a Total cell. The following is my current formula for cell D4. =IF(SUMPRODUCT(($ L14:$ BW14<>"")+0) >= 4,IF(TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-3)) = "Total", TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-2)), TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-3))),IF(SUMPRODUCT(($ L14:$ BW14<>"")+0) = 3,IF(TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-2)) = "Total", TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-1)), TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-2))),IF(SUMPRODUCT(($ L14:$ BW14<>"")+0) = 2,IF(TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-1)) = "Total", TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>"")))), TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))-1))),IF(SUMPRODUCT(($ L14:$ BW14<>"")+0) = 1,IF(TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>"")))) = "Total", TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))+1)), TO_DATE(OFFSET($ K$ 2,,SUMPRODUCT(--({$ L$ 14:$ BV$ 14}<>""))))),IF(SUMPRODUCT(($ L14:$ BW14<>"")+0) < 1,"")))))

Export Additional Columns in Version History Export SP 2013

I found this solution on this forum and was able to pull some information but with the workflow we have on the list, we need more information. We have an “Approval Status” column that we can see when it’s updated when I look at the individual item’s version history. Is there a way to modify this script to include it in the report? I tried adding it “Approval Status” to both places where I see the column names below but that did not work. TIA!

# ******* Variables Section ******************

Define these variables

$ WebURL=”http://sharepoint.crescent.com/sites/Sales/” $ ListName =”Invoice” $ ReportFile = “D:\Invoice_VersionHistory.csv”

*********************************************

delete file if exists

If (Test-Path $ ReportFile) { Remove-Item $ ReportFile }

Get the Web and List

$ Web = Get-SPWeb $ WebURL $ List = $ web.Lists.TryGetList($ ListName)

#Check if list exists if($ List -ne $ null) { #Get all list items $ ItemsColl = $ List.Items

#Write Report Header Add-Content -Path $ ReportFile -Value “Item ID, Version Lable, Created by, Created at, Title”

#Loop through each item foreach ($ item in $ ItemsColl) { #Iterate each version foreach($ version in $ item.Versions) { #Get the version content $ VersionData = “$ ($ item.id), $ ($ version.VersionLabel), $ ($ version.CreatedBy.User.DisplayName), $ ($ version.Created), $ ($ version[‘Title’])” #Write to report Add-Content -Path $ ReportFile -Value $ VersionData } } } Write-Host “Version history has been exported successfully!”

How to communicate visually the ability to change columns in a table

Often websites may include functionality that allows a user to select what columns appear in a table. When this occurs, what is the best way to visually communicate this action, so the user both understands it is possible and knows how to perform it?

We are trying to implement this functionality on our site, but we are at a loss for a good way to indicate it. Two icons have been suggested (a pencil and a hamburger) but they are both very general and may not be clear. It’s not obvious that this functionality can be indicated with an icon.

Pencil edit

burger menu

Are there any alternatives to this approach?

Position of collapsed columns

I’m wondering to put two columns inside a form-row, both col-6 (I’m using bootstrap 4), and trying to collapse them. When it has not a “collapse div” it works pretty good, bu if I put a collapse div it shows in vertical position. i would like that them keep horizontal position.

I’ve reproduced my problem in jsfiddle: fiddle code:

        <div class="form-row">           <div class="collapse col-12" id="myCollapse1">               <div class="col-6 bg-primary">               <div class="form-group">                 <label>Name</label>                 <input type="text" class="form-control" value="John">               </div>               <div class="form-group">                 <label>Surename</label>                 <input type="text" class="form-control" value="Joseph">               </div>             </div>             <div class="col-6 bg-warning">               <div class="form-group">                 <label>Email</label>                 <input type="text" class="form-control" value="John@site.com">               </div>               <div class="form-group">                 <label>password</label>                 <input type="text" class="form-control" value="jj123">               </div>             </div>           </div>         </div>       </form>     </div>     <div class="col-1">       <button class="btn btn-primary" data-toggle="collapse" data-target="#myCollapse1" aria-expanded="false">Collapse</button>      </div>   </div> </div> 

Validate Date Columns that allow for blanks

I have a list with three date columns, Start Date, Due Date and Extended Due Date. I need to have validation set so that the Due Date is no later than 14 days from the start date and the extended due date is no later than 30 days from the start date. But the validation also needs to ignore when either column is empty. I can get the formula so that it’ll validate one or the other but not both.

Trying to modify it I keep getting validation errors. Can anyone help?

My formula =IF(AND(ISBLANK [Permit End Date]>=[Permit Start Date],IF(DATEDIF([Permit Start Date],[Permit End Date],"d")<=14,True,False),False))IF(AND(ISBLANK IF([Extension End Date]>=[Permit Start Date],IF(DATEIF([Permit Start Date],[Extension End Date],"d")<=30,True,False),False)))

Add variable columns to INSERT statement

I’m learning SQL using python library pymysql.

I wanted to make an INSERT statement variable so if I wanted to change the value of 3 columns or the values of 10 columns I could do it with the same code by just passing the Database name, the Columns name and the Values.

Thus I made this:

def insert_statement(db,cols,values):     separator = ","     separator.join(cols)     statement = "INSERT INTO " + db + " (" + separator.join(cols) + ") VALUES ("     aux = []     for i in range(0,len(values)):         aux.append("%s")      statement = statement + separator.join(aux) + ")"     print (statement)     return statement 

Passing the values, the funciton produces:

>>>INSERT INTO Publicaciones (item_id,title,price) VALUES (%s,%s,%s) 

Which works but, is it there a more pythonic way?