I have list in MS Word table.
Items have subitems, each in separate row. Each subitem have indentation.
I need a way to sort this only items in this list, subitems should move with them.
I have same list in Excel also but I didn't manage to do much with it there too..
Let's call each item parent, each subitem child. Then following algorithm can be helpful.
Give to each parent id
To each child assign it's parent id
Sort Parents.
Display hierarchy again.
My understanding of task:
item 1
subitem1a
subitem1a1
subitem1a2
subitem1b
subitem1c
item 2
subitem2a
subitem2b
Suppose you want to sort it by descending, and displayed list should be presented like this:
item 2
subitem2a
subitem2b
item 1
subitem1a
subitem1a1
subitem1a2
subitem1b
subitem1c
Am I correct?
Related
Relatively new to Blue Prism,
I have a collection that looks like this, with 100+ rows:
Results
Answer
Timestamp
8 Apr 2021
Name
ABC
I'd like to manipulate the data such that if Results = 'Name', Get the Answer (aka ABC) and put it into a data item.
Is there any way to do this?
I understand I could hardcode i.e. Get value based on Row Index and Column Index, but my data is complex and may not always have the same rox index.
Can you use the collection filter to get a collection output? The utility has an action to filter where you can input a collection and then use
[FieldName] Like "some value"
This would result in every complete row in the collection that matches the filter.
I am trying to create a Treeview - here is my code:
def treeview(self):
tree = Treeview(self.parent, columns=("no","name","props","subs", "summary"))
tree.heading('#0', text='No.')
tree.column('#0', width=100)
tree.heading('#1', text='Name')
tree.column('#1', width=100)
tree.heading('#2', text='Props')
tree.column('#2', width=100)
tree.heading('#3', text='Subs')
tree.column('#3', width=100)
tree.heading('#4', text='Summary')
tree.column('#4', width=100)
tree.place(relx=0.5,rely=0.2, anchor=CENTER)
There should be 5 columns - However, there is sixth blank column to the right of the last column. Why is this?
Also, how do I actually add text to each column? Thanks!
The 0'th column in a TreeView is always the "icon column" - see this manual page, where it says:
Your Treeview widget will be structured with multiple columns. The first column, which we'll call the icon column, displays the icons that collapse or expand items. In the remaining columns, you may display whatever information you like.
So my best guess would be that when you try to specify a label for column 0 Tk is adding one? (making the total 6).
As for adding text to the items of your Treeview.. Again, the manual page says:
Starting with the top-level entries, use the .insert() method to populate the tree. Each call to this method adds one item to the tree. Use the open keyword argument of this method to specify whether the item is initially expanded or collapsed.
If you want to supply the iid value for this item, use the iid keyword argument. If you omit this argument, ttk will make one up and return it as the result of the .insert() method call.
Which covers how to insert rows, then to "actually add text to each column":
values: This argument supplies the data items to be displayed in each column of the item. The values are supplied in logical column order. If too few values are supplied, the remaining columns will be blank in this item; if too many values are supplied, the extras will be discarded.
Thus, tree.insert(values=[3,"Fred",'prop','sub','guy named Fred']) would insert a row with the given values for the columns you have defined.
I have 2 lists: listA and listB
listA has 2 fields:
Title (text)
PortalID (text)
listB has 3 fields:
Title (text),
listAField(lookup to listA Title field)
UserID (text)
I have a UserID value and I need a quick way to get PortalID value.
Currently I'm using 2 SPQueries:
1.Gets listAField value
2.Gets PortalID value.
Is it possible to do everything using one lookup directly? or some other more efficient way ?
you can use SPServices for this, using cascading dropdowns, you can find more info here: http://www.sharepointkings.com/2010/09/sharepoint-cascading-drop-downs-using.html this saved my life a lot of times already.
when you are making lookup you can check which fields from list A you want to come with title. Just check checkbox with field PortalID
Alright, here's my scenario :
I have 2 custom lists : Orders and Items. The Items list contains a field Description (text) and a Amount Per Item field (calculated). The Orders list contains a Total amount field and a Items field (lookup on the description field in items which allows multiple values selection).
Here's a more visual explanation :
Orders
Total amount
Items (lookup on the description field in items which allows multiple values selection)
Items
Description (text)
Amount per Item
I would like to do the sum of the Amount per Item field of the selected items from the Items lookup field from Orders and put the value of the sum in the total amount field in Orders
Any suggestions? Is it possible to do this in SharePoint 2010 without code? If not, could you show what the code would look like?
Thanks.
You could try
OrderList.Total = OrderList.Items.Sum(item => item.AmountPerItem);
I have predefined item combination (for example brand1|brand2|brand3 etc) in the table.
i like to collect brands and check against with predefined table data.
For example i collected brand1|brand2|brand3 then i can do get some value form that predefined table(it meets the condition).
How can i check?
brands would be unlimited. also brand1|brand2|brand3 of brand1|brand2| exist then returns true.
Okay, taking a wild guess at what you're asking, you have a delimited field with brands in them separated by a | character. You want to return any row that has the right combination of the brands in there, but don't want to return rows with, for example, brand "testify" in them when you search for "test".
You have four search conditions (looking for brand3):
the brand exists by itself: "brand3"
the brand starts the delimited field: "brand3|brand4|brand6"
the brand is in the middle of the field: "brand1|brand3|brand6"
the brand is at the end of the field: "brand1|brand2|brand3"
so, in SQL:
SELECT *
FROM MyTable
WHERE BrandField = 'brand3'
OR BrandField LIKE 'brand3|%'
OR BrandField LIKE '%|brand3|%'
OR BrandField LIKE '%|brand3'
Repeat as required for multiple brands.