Operations on the controls within the repeater control - orbeon

A form in a Orbeon form builder contains a repeater control(new repeat).Suppose there are three text controls on each row(or repeat) of a repeater control(new repeat).first two text controls on each row contains numeric values.I want to bring the product of first two text controls to the third text control at run time without any event.there will be multiple numbers of repeat in the runtime ,i.e the row may increase but for each the calculation much reflect at runtime and for each row product of first two must be viewed on the third one

Name the fields in the first and second column (click on cog wheel to the right of the field). Say you picked the names quantity and price.
For the 3rd field, enter the following XPath expression in calculated value, all in one line (in the Edit Validation Properties you get by clicking on the red exclamation mark):
if ($quantity castable as xs:double and $price castable as xs:double)
then $quantity * $price
else 'n/a'
You refer to other controls by name, preceding the name by a dollar sign, and here we check that a value is indeed a number with $gaga castable as xs:double.

Related

How do I get a value from another sheet, a specific row and column based on dropdown value with a range?

I've created a LANGUAGE sheet with each word in a row and its translation in the next row. I can now add new languages as needed by adding columns with translations.
I've then set up a language dropdown menu containing all languages (=LANGUAGES!$1:$1) automatically.
Now, HOW do I put the value in a cell based on the dropdown?
Say I have the word 'Faktura' in the first column (second row) under the language 'DA' (first row) and the word 'Invoice' in the next column under 'EN'.
Put this word in the cell if the Dropdown has DA selected otherwise put this word in the cell if the Dropdown has EN selected.
Hope this makes sense. I'm pretty sure it's simple, but I can't wrap my head around how to make Google Sheet do what I want it to.
I've been wildly guessing with things like: =LANGUAGES!$1:1???????=F3<-DataValidationField) ... simply cannot figure out or even guess what to write in the formular. Mind bendingly counter intuitive.
Use: =HLOOKUP(F3;LANGUAGES!A:B;2;false)
Where F3 is the cell for the dropdown (the range) A:B represents the col range and 2 the row to get the word from ...

Google Sheets - Cumulatively Add Values in Different Cells

How do you add up values in different cells?
I'm looking to create something similar to: https://i.etsystatic.com/7867478/r/il/09bb36/3897355233/il_1588xN.3897355233_koef.jpg
You will notice in the "expenses summary" box there are different descriptions such as food.
In the lower right corner, there are dropdown boxes for the category. There are multiple categories selected with varying amounts next to it.
Back to the "expenses summary" box there is a column named "actual" which adds up the values in the expenses tracker box.
In this case, this is $55 + $200 + $50 for food albeit in different boxes.
How does one add add these values up in a sheet where the category variable can be changed at anytime?
I have used vlookup to no avail. Fixing the cells would not work due to the variability of it.
There's no way of automatically modifying everything since it's notanother type of databases. The easiest way in my opinion is go to Edit - Find and Replace and Replace All those values. If the Data Validation is linked to a range, then it will be updated too

Google Sheets consecutive rows when multiple checkboxes are ticked

I am looking for help with this sheet. I have some item names and images next to those. They belong together.
Whenever I tick the first checkbox in the item sheet, I want the item name and the image to be displayed in Sheet 2. I have managed to do that with the formula in A1 for the image
=Iferror(VLOOKUP(B1,Items!B4:F15,2,FALSE),"")
and for the item name formula in B1 I used
=iferror(QUERY(Items!B4:F15,"select B where D=True"),"") .
My problem is:
When I tick the first checkbox of any item, the item gets normally displayed in Sheet2 with the belonging image. When I tick the second checkbox for that same item (x2), I want the same item to be displayed right again in the second row in Sheet2 with the belonging image again. If I tick the third checkbox, I want it to be displayed three times basically below each other with the belonging image.
Is that possible without scripts?
https://docs.google.com/spreadsheets/d/1tjyBIMDWbM4AxuQby4vmEUeFgqLbxN1EPk1pGqEX_64/edit?usp=sharing
You can try
=sort(filter({
ifna(filter(Items!B4:C,Items!D4:D),{"",""});
ifna(filter(Items!B4:C,Items!E4:E),{"",""});
ifna(filter(Items!B4:C,Items!F4:F),{"",""})},query({
ifna(filter(Items!B4:C,Items!D4:D),{"",""});
ifna(filter(Items!B4:C,Items!E4:E),{"",""});
ifna(filter(Items!B4:C,Items!F4:F),{"",""})},"select Col1")<>""))
UPDATE: Better approach
=sortn({
ifna(filter(Items!A4:B,Items!D4:D),if({1,1},char(999)));
ifna(filter(Items!A4:B,Items!E4:E),if({1,1},char(999)));
ifna(filter(Items!A4:B,Items!F4:F),if({1,1},char(999)))},
countif(Items!D4:F,true),,2,1)
Essentially we are filtering the data three times (one for each checkbox), stacking all the results together and sorting them in ascending order. The if({1,1},char(999)) is used as padding in case there's no match (i.e. no checkbox is ticked) to prevent ARRAY_LITERAL. The idea with char(999) is to have a character that goes to the bottom of the list when the range is sorted so we can exclude it with sortn(). I don't know how Google Sheets sorts when special characters are involved (if anyone does please let me know) but char(999) seems to get the job done.

How to group columns by header in Google Sheets?

I have multiple tables populated in the same sheet, but need them in a single table. How do I dynamically create a single table? The raw data will change, so it needs to accept additional rows as they populate.
Here is a demo document with the raw data and desired effect.
https://docs.google.com/spreadsheets/d/1V8ytyN-qSUW0Wrba7FxmQ242YXSNQ18y6nneEz6bS5g/edit?usp=sharing
Your raw data should remain alone in its sheet. So first, remove everything you currently have in Sheet1!A12:D, since it will interfere with your ability to write formulas that allow the raw data in A:D to expand downward.
Once you've removed that, add a new sheet. In that sheet, use this formula:
=QUERY({Sheet1!A3:D3;Sheet1!A4:D;Sheet1!F4:I},"Select * Where Col1 Is Not Null")
The curly brackets allow the formation of a virtual array. Within those curly brackets, a semicolon means "place what comes next below" while a comma would mean "place what comes next beside." Understand that such virtual arrays must keep parallel structure at all times; for instance, you can't place a range that's four columns wide over one that's only three columns wide.
As written, those stacked ranges go all the way to the bottom of the sheet, since there is no row number on the second part of the range (e.g., A4:D means "the range that starts with A4 in the upper left and runs to the bottom of Column D, wherever that is"). By doing this, you are always able to include more data without adjusting the formula.
All that is left to do is weed out blank rows. The outer QUERY as written allows us to trim that virtual array to to only those rows where the first column is not empty.

How to restrict combobox to show only not-yet-selected items in Google Sheets?

My question is simple, but I am afraid that there is no solution for this.
I want to create 3 combo boxes in 3 lines in a column.
The combo boxes have only 3 values.
If I select an item from the combo box, then the other two combo boxes should have only the remaining 2 items to select.
If I select an item from a second combo box, then the last one should have only the remaining 1 item to select.
If I clear the first combo box selection, then the first and last combo boxes should have only the remaining 2 items to select again.
Is this possible somehow in Google Sheets?
There definitely is a solution for this, you're just going to need some separate formulas.
Reserve 9-12 cells (depending if you want headers) and label them so that you know which dropdown they refer to (i.e. box 1, box 2, box 3).
Under Box 1, simply list your 3 values.
Under Box 2, enter the formula =filter(C2:C4, A1<>C2:C4) replacing C2:C4 with the range of Box 1's three values, and A1 with the cell of the first dropdown box.
Under Box 3, enter the formula =filter(D2:D4, A2<>D2:D4), replacing D2:D4 with the range of Box 2's three values, and A2 with the cell of the second dropdown box.
Now, just insert dropboxes and set the list range to the three ranges from above. The formulas will cause the cell values to change, and in turn change the dropbox values.
And that's it! If you would want them to all be independent, as it seems the last part of your question asks for,(ex. choosing a value in Box 2 first and then Box 1 and 3 changing accordingly) it would just require some longer formulas. I can work on that, but i wanted to get this to you first to be sure this is what you were asking for.
Spreadsheet: https://docs.google.com/spreadsheets/d/15YLW7qL685FJjXKPE0uWTM50YhygpOZqK0UW4u48atI/edit?usp=sharing

Resources