How to separate label and the text field in alpacajs - alpacajs

I am using alpacajs to render a form automatically.
I want to separate the label and the input so as to set them under separate column.
Like
COL1 | COL2
lastname | lname textbox
firstname | fname textbox
This can't be achieved as i don't have any options while specifying schema/options.
Thanks for your help.

If you want to have this kind of presentation, alpaca have a buil-in view template for that, you could use the "bootstrap-edit-horizontal".
"view": "bootstrap-edit-horizontal"
Here's a fiddle.
Tell me if you want something else :)

Related

How to replace a column value using PowerQuery editor

I'm relatively new to Power Query. I'm looking for the best way to replace a column's value as below.
The column has date values in a mixed format such as below.
09/16/2022
09/20/2022
09/26/2022
09/30/2022
10-01-2022
10-03-2022
10-05-2022
I'm looking to standardize and make the format generic as below.
09-16-2022
09-20-2022
09-26-2022
09-30-2022
10-01-2022
10-03-2022
10-05-2022
It seems one of the ways to implement this is to use Advanced Editor and build M queries to implement the replacement, functions like Table.TransformColumns and Text.Replace.
'can't figure out the exact code to be used with this or if there is a better way.
Looking for suggestions. Thanks.
If you're a beginner, let the UI write this code for you. Highlight the column by clicking the column header, go to Transform on the ribbon and click Replace Values. Replace "-" with "/" and click OK.
Finally right click the column header again, click Change Type and then select Date.
In M code you could use:
Table.TransformColumns(#"Previous Step",{{"Column Name", each Text.Replace(_,"/","-")}})
As an example:
let
//create sample table
Source = Table.FromColumns(
{{"09/16/2022",
"09/20/2022",
"09/26/2022",
"09/30/2022",
"10-01-2022",
"10-03-2022",
"10-05-2022"}},
type table[dates=text]),
//replace "/" with "-"
Normalize = Table.TransformColumns(Source,{{"dates", each Text.Replace(_,"/","-"), type text}})
in
Normalize
Source
Results
Notes:
Original data is dates as text strings
Final data is also dates as text strings
To convert the strings to dates, you could use, instead, something like: Table.TransformColumns(Source,{{"dates", each Date.From(_, "en-US"), type date}}) but the separator would be in accord with your Windows Regional date settings.

How to add a custom title to oracle apex sql command query result

I am trying to a add a custom title to my sql query result in APEX sql command, can't seem to find a solution how.
The title is something like this:
"My custom title on top of the columns"
Customer Name | Stock Number | Date Hired | Model Name
You mean something like this?
SELECT [table_column1] as "Customer Name",
[table_column2] as "Stock Number",
[table_column3] as "Date Hired",
[table_column4] as "Model Name"
FROM [table_name];
From what you clarified in the comments it appears you are looking to set the title for an area.
That depends what area it is, probably either an interactive report or interactive grid. The attributes of those have a setting to set the title.
You can use Oracle alias including column and table aliases to make the heading of the output more meaningful and to improve readability of a query.
To instruct Oracle to use a column alias, you simply list the column alias next to the column name in the SELECT clause as shown below:
SELECT
first_name AS forename,
last_name AS surname
FROM
employees;
The AS keyword is used to distinguish between the column name and the column alias. Because the AS keyword is optional, you can skip it as follows:
SELECT
first_name forename,
last_name surname
FROM
employees;
By default, Oracle capitalizes the column heading in the query result. If you want to change the letter case of the column heading, you need to enclose it in quotation marks (“”).
SELECT
first_name "Forename",
last_name "Surname"
FROM
employees;
As shown in the output, the forename and surname column headings retain their letter cases.
If the column alias consists of only one word without special symbols like space, you don’t need to enclose it in quotation marks. Otherwise, you must enclose the column heading in quotation marks or you will get an error.
See the following query:
SELECT
first_name "First Name",
last_name "Family Name"
FROM
employees;

Remove seconds from the timestamp field in PowerBI

I am new to PowerBI and hence this question might be very simple but it would be very helpful if you help me with it.
I have a field in my table "A_Timestamp" and the value is
01/02/18 12:08:25
I want to ignore the seconds and display the result as
01/02/18 12:08
How can this be achieved?
Thank you very much in advance.
Regards,
Ani
I would use the Query Editor and add a Custom Column, with a calculation something like the following:
= DateTime.From ( DateTime.ToText( [A_Timestamp] , "yyyy-MM-dd HH:mm") )
You can then add steps to remove the original A_Timestamp column, rename the added column, and reset the datatype to Date/Time.

Tabular Forms Column merging Oracle Apex 5

Does anybody know how to merge two columns of tabular form into a single column?
This is an example:
You can do that by applying html codes in your query.
Try this in your query
SELECT attendance,
member_id,
name,
saving,
'<input class=''u-TF-item u-TF-item--text '' style=''text-align:center;'' name=''repayment'' value='||repayment||'></input>'||'<br>'||
'<input class=''u-TF-item u-TF-item--text '' style=''text-align:center;'' name=''profit'' value='||profit||'></input>' repayment,
FROM
your_table
WHERE
...
assuming that their header is the same as their column name;
class was just copied from the other column to match their appearance.

How do you concatenate two variables for the text of a select.genericlist

in this select.generic list I am wanting to concatenate two variables/fields for the "text" of this list. It is a functioning list.
<?php echo JHtml::_('select.genericlist', $this->assets, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'serialnumber' , $this->asset->link);?>
Where 'serialnumber' is the field used for the text of the list, I am trying to get 'model' AND 'serialnumber' so that it displays "Model: serialnumber" in the select list.
Everything i have found for concatenation does not work, and seems to just make a string 'model:serialnumber' which is a non-existant field.
using $model . $serialnumber is a no go as well, though using just one variable works fine.
Thanks for the help!
Simplest thing would be you do a concat at the db level.
So when generating $this->assets you put something like this in the query:
SELECT bla1, bla2, CONCAT('Model: ', bla3) AS text ...
or
SELECT bla1, bla2, CONCAT(model, ': ', serialnumber) AS text ...
if model is a db field.
Taking what Mike said I found where I needed to make the change to the query in the category model of my component. I wasted a lot of time thinking it had to be in the asset model:
$query->select($this->getState('list.select', 'a.id, a.name, CONCAT(a.model,\': \', a.serialnumber)AS modelserialnumber, ...
$query->from('`#__asset_details` AS a');
Thanks Mike for your help!