Getting commas in number format in OpenSearch Dashboards - kibana

I changed the Field Type from string to integer from there the value I am getting is with commas in between the value. Example mobile number(9748376253) destination field as (9,748,376,253), this is because the default number format in opensearch will take as 1000's place so it divides in such a way. So by following the below stackoverflow i changed accordingly(Kibana unwanted thousand-seperator) as type number and changed the format to 00.[000] from 0,0.[000]. but changes are not effected. Will it take time to effect or any other issue ? Is there any option to change this format number setting only for one particular index ?

Related

Max for woocommerce attribute VALUES

I am apparently exceeding the maximum characters allowed for the attribute VALUES in woocommerce, and I can't seem to find what the max actually is.
Clients will ultimately be adding products once I do the original set up, so it adding them as custom variables is something I want to avoid.
I also don't want to have to mess with functions; I'm trying to limit the actual values to less then the max.
Thanks in advance :)
The attribute Values will be saved in table (wp)_postmeta,
in the meta_value column (meta_key is _product_attributes).
This column is from "Longtext" type.
Longtext from the MYSQL Doc.:
"A TEXT column with a maximum length of 4,294,967,295 or 4GB (232 – 1) characters. The effective maximum length is less if the value contains multi-byte characters. The effective maximum length of LONGTEXT columns also depends on the configured maximum packet size in the client/server protocol and available memory."
Link to MYSQL Doc.
Woocommerce saves more than this Value in the field.
Here is an example:
a:1:{s:4:"attr";a:6:{s:4:"name";s:4:"attr";s:5:"value";s:5:"1 | 2
";s:8:"position";i:0;s:10:"is_visible";
i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}}
At the End of the first line you see 1 | 2, this are my test attribute Values.
I had same problem and solved it today so I'm gonna say what I done if someone will search for it again. So you can go to your wp-content / woocommerce / includes / wc-attribute-functions.php and just ctrl + f for 28. There is the max number for your attribute slug. If you want find another places like not slug, but name and etc. just download whole woocommerce folder and search it with editor witch allows you to search for multiple files. But also I'm pretty sure your code changes will be wiped out when you update woocommerce.

Is it possible to filter the list of fields when outputting a Full Dataset?

I have a DataTable that I'm passing to a FlexCel report. It contains a variable number of columns, so I'm using the Full Dataset feature (e.g. <#table_name.*>).
However, only a subset of the fields are dynamically generated (I have a variable number of attachments). The column name for each attachment field starts with a common word (e.g. "Attachment0", "Attachment1", etc).
What I would like to do is output the known finite set of fields and then the variable number of attachments. It would be nice if I could write something like <#table_name.Attachment*> (and <#table_name.Attachment**>). Is there any way in FlexCel Reports I can achieve the same result?
A side benefit to such a solution means that I could keep the formatting for the known/finite set of fields.
Update
I added place holder columns to the document, each with a <#delete column> tag, so that the un-wanted columns/data are removed.
Although this works, it's not ideal. For example, if I want to see how the columns fit in the page width (in print preview), then I need to hide the columns. Then I have to remember to un-hide them again, so other developers can see/understand my handy work.
It would be much more straight forward if I could filter the fields before they're output to the document.
I realised there's an alternate way around this problem. I broke up the data into two sets of data - <#table_name.*> and <#table_name_attachments.*>.
The fixed set of fields are in the first table and the variable set of fields is in the second table (all the "Attachment*" fields). When the report is run, I place them next to each other (in the same order) in the same worksheet. This means I have two table ranges - "_table_name_" and "_table_name_attachments_" on the one sheet.
Now I'm able to run my print preview without hiding/re-showing the columns-to-be-deleted. I've also eliminated human error - it was all to easy to accidentally set the wrong number of padded/delete columns.

QTableWidget setSortingEnabled on specific column Qt

I have a table widget that contains 2 columns. The first column contains timestamps, and the 2nd column contains the message that corresponds with the timestamp. I want the user to be able to click on the header for the timestamp column and reverse the order. I also want the user to be able to click on the message header and have all the messages be put in alphabetical order. Using setSortingEnabled works perfectly for the message header, but due to the format of the timestamp, this will not sort the timestamps correctly. Is there a way to setSortingEnabled() on just the messages column, and when the user clicks on timestamp header it calls a custom function that sorts?
SetSortingEnabled() affects all columns.
You can setSortingEnable(False), create a function with custom sorting for the timestamp-column and standard sorting for the other columns and connect the horizonterHeaders signal sectionClicked() with this function. I tried in pyqt5, it works, but much work with recognizing the actual sortOrder, setting and deleting headerIcons etc..
A much easier way is, to set an appropriate format for the timestamp, right-aligned, fixed length, on the left filled with '0', in python3 e.g.:
ts = '{:0>15}'.format(timestamp)
left filled with spaces works too:
ts = '{: >15}'.format(timestamp)

Control input of SQLite attribute to date format only.

I have been reading all about converting TEXT fields into date formats and ways to use Python to create date objects but my question remains.
My table has a dateTime column that is specified as TEXT, I would like to build a constraint that forces input to be in dateTime format, but as SQLite doesn't do dates (as I would like) I haven't worked out how to do it.
My current ideas: 1. Limit number of characters
2. Set separate attributes for day, month and year and constrain their domains
3. It is silly to do this on the database side just do it in the user interface
I would appreciate your opinions on these or other options.
Thanks :)
I've been trying to solve the same issue and the method I came up with was to use the date/time functions to parse the value and check that it hasn't changed. Essentially the following:
CREATE TABLE dts_test (
dts TEXT CHECK (dts IS datetime(dts))
);
If the default format is not what you want you can use the strftime or similar to design whatever format you want, but it must be something that the built-in date and time functions can parse.

Display value in Date field irrespective of date format

I have an mx:DateField in my Flex UI that has a formatString="dd.mm.yyyy" attached to it. However, the initial value for that field may not be in the format specified/defined for the DateField (due to legacy reasons). So, currently, if I just set that value (text) on the DateField, the field is shown empty. I think because it fails to accept the value in a format different than what's configured.
I need to (somehow) be able to display the incoming value in the date field. Is that possible? If yes, how?
P.S. : The incoming value's format will not be known, so I cannot transform it to my desired format :(.
Parse the value into a date first, then use the dateField's dateToString method to set the text.

Resources