How to I separate numbers? - numbers

How do I separate a combination of numbers AND move them into specific cells based on their variable?
For instance Cell A! contains the numbers: 3, 4, 10, 58, 26
Title tabs are: 0>2 3-18 19-54 55+
I want each number for over 10,000 lines to be moved so that I do not have to do it manually. Is there a way?
I've tried to what if but I am not an expert on this particular kind of problem.

If this is in Excel and your table looked something like this at the start
#A 0>2 3-18 19-54 55+
3
4
10
58
26
Try putting something like this in each cell under each title, then copy all the way to bottom of columns.
=IF(AND(A1>0 ,A1<3),A1,0)
=IF(AND(A1>2 ,A1<19),A1,0)
=IF(AND(A1>18 ,A1<54),A1,0)
=IF(AND(A1>54),A1,0)
Result will be the number in col A1 moves or a 0

Related

MS Word mail merge: MERGESEQ and MOD

Field codes:
Data:
Expected result:
Actual result:
I was thinking about where I should tweak the codes to fix the issue that the first column of each has three records as other columns do.
Also, a new class name (i.e. 1A, 1B) should be added to the second sheets (i.e. the second and fourth pages).
Thanks in advance for any help!
You need something more like this:
There were two problems - a change of class causes a page break, so at that point you can't rely on on the { =mod({ MERGESEQ },3) } = 0 to show you the right place to break next. Because a column break can also cause a page break, you also have to keep count of the columns to ensure that you can insert the class name every time you have a new page.
An advantage of doing it this way is that you can easily change the number of columns and rows per page.
(I have put one other thing in there, because strictly speaking you need to initialize Class1 when you start the merge).

How to show more element of number picker list in flutter?

I used this for developing a number picker for my flutter application but it shows only three element of list of numbers in number picker . I want to show more element(for example 7) and beside, I want the selected element be exactly the middle element (in my case 3 element before and three after) which part of the library code should be changed?
When just changing "_listViewHeight = 3 * itemExtent", in library we see the problem I mentioned in image below. First the selected Item is not the middle one beside the maximum value can not be selected.
I had this same problem and was able to get it working for odd display number lengths of 3 or greater after digging into the numberpicker code and making some changes. Here is a diff of the changes I made. This is working for me using my repo. You can also just copy the lib/numberpicker.dart file from my repo into your project and include that file. Hopefully will get this pulled into the numberpicker project at some point. Below is my example use for 7 numbers displayed at a time:
NumberPicker.horizontal(
initialValue: _currentValue,
minValue: 1,
maxValue: 10,
numberToDisplay: 7,
onChanged: (newValue) =>
setState(() => _currentValue = newValue));
and scrolled to the first number
you can pick a different odd number for the numberToDisplay parameter such as 5
and removing the parameter will use the default of 3.
More info here
At here and here
Change
_listViewHeight = 3 * itemExtent,
to
_listViewHeight = noOfElements * itemExtent,
where noOfElements is the number of elements you want to display.

Avoid repetition when selecting two columns of same table

Each time I would like to work on two variables from the same table, I repeat the table's name for selecting them like in the following example:
boxplot(hospital.Weight, hospital.Sex)
This is a problem if the table's name changes because it requires two further changes to get it right.
Is there a more elegant way to avoid the repetition in the function call?
I tried:
boxplot(hospital( : , {'Weight', 'Sex'}))
But this returns the columns as tables and boxplot as far as I understand only takes vectors.
What I would do is create a dummy variable before generating your box plot so that you'd only have to change one line:
table_name = hospital; %this is the line you'd change if the table name changes
boxplot(table_name.Weight, table_name.Sex)
The answer by #qbzenker is probably the best approach, but if you look for somthing else, you can use cell arrays for this:
C = table2cell(hospital(:,{'Weight','Sex'})); % this is the only place to change the table name
boxplot([C{:,1}],[C{:,2}])
If you want this in a nicer syntax, you can write a small function like:
function my_BoxPlot(T,F)
C = table2cell(T(:,F));
boxplot([C{:,1}],[C{:,2}])
end
and then call it with your preferred syntax:
subplot 121
my_BoxPlot(hospital,{'Weight','Sex'})
subplot 122
my_BoxPlot(hospital,{'Age','Sex'})

For either Libreoffice or Word, how do I insert this kind of field?

I am writing a play, and I want to be able to insert two fields, much like Page #. Let me explain...
Each time Scene 1, Scene 2, Scene 3, etc., I want the pages in that particular field to be named after it. So, Scene 2 would be 15 pages, and it would have a 2 on each of those pages. Then on Scene 3, it would have 20 pages, and I want each of those pages with a 3.
Also, I want to do this for Act I and II. For each page in Act I, I want the roman numeral I. For each page in Act II, I want the Roman numeral II.
I was wondering if there is a particular kind of code I can use in either Libreoffice or Word? For example, when "Scene 2" is detected by the software, it writes "2" on that pages and continues to repeat on each proceeding page, until it detects "Scene 3" and inserts 3, instead of 2, on the proceeding pages. I want do the same thing for Act I and Act II.
So basically, I want to insert fields for both of these. Thanks.

How to replace crosstab cell's value with a string

I have column fact, it can carry some difference values:
- Positive values - real values, need to be outputted as is
- 0 is null, output as is
- -1 - special value. Need to ouput "VAC" string in cell.
- -2 - special value. Need to output "SICK" string in cell.
I tried to do it with editing dimension, i replace it with:
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC'
when [BaseEmp].[FACT_VALUE] = -2 then 'SICK'
else to_char([BaseEmp].[FACT_VALUE])
end
But now I see error: ORA-01722 invalid number (i think, because strings cannot be aggregated). In column properties I select "min" as aggregate function.
How to replace my special values with strings?
You don't need to change value to VAC, SICK etc.
You need to change DISPLAYED value.
Unlock the padlock in RS.
Select text in your cell
Set text source to "Report Expression"
Write expression like
CASE
WHEN cellValue() = -1 THEN 'VAC'
WHEN cellValue() = -2 THEN 'SICK'
WHEN cellValue() = 0 THEN ''
ELSE cellValue()
END
I tried thinking of a work around regarding your problem. I'm not really sure what you crosstab looks like but considering your parameters above, try creating a data item which holds your case condition for your fact.
Ex.
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC' <--- this will produce Any Error Characters
when [BaseEmp].[FACT_VALUE] = -2 then to_char([BaseEmp].[FACT_VALUE]/0) <--- this will produce Missing Value Characters
else to_char([BaseEmp].[FACT_VALUE]) <---- as is
end
Then set the data item's Data Format to number and set the values for the properties as follows:
Kindly give this a try and hopefully it can somehow resolve you problem. Cheers!
Nikita Kuhta checkout Alexey's Baturin's answer. I think it's the appropriate approach. Just one thing if you unlock and select the text in the cell, all of the cell values will be selected and affected by the report expression. You might have several columns or other fact items in the crosstab. If that's the case, what you can do is
Unlock the Report.
Select the crosstab cell/intersection you want to change.
Set the Define Content to Yes.
Drag a Layout Calculation in the crosstab cell/intersection, then insert your case statement.
Thanks to a friend who told be about the define contents. :D