neodash
neodash copied to clipboard
Integer handling in queries
There appears to be a bug when Neodash is handling integers converted from strings - it appears to be inserting a comma into the integer, which makes it not work in subsequent operations.
To help us understand your issue, please specify important details, primarily:
-
NeoDash version: 2.4.4
-
Neo4j Database version: 5.17 Enterprise
-
Steps to reproduce
-
Create a Tabular Report
-
In the report, use a query to simulate the input of a list of integers, which will initially be strings, but will converted behind the scenes to integers, as follows:
WITH ('4125, 4128') AS neodash_custom_01
WITH apoc.text.replace(neodash_custom_01, '\ ', '') AS atr
WITH apoc.text.split(atr, ',') AS ats
RETURN TOINTEGER(ats[0])
-
Expected behavior The RETURN should be an integer of "4125"
-
Actual behavior The RETURN is actually "4,125", which doesn't work in subsequent MATCHes using the integer.
Thank you for reporting the bug, but i can't reproduce it. here my dashboard where i try to reproduce it:
{ "title": "New dashboard", "version": "2.4", "settings": { "pagenumber": 0, "editable": true, "fullscreenEnabled": false, "parameters": { "neodash_ciao": { "low": 4125, "high": 0 } } }, "pages": [ { "title": "New page", "reports": [ { "id": "b51d8d50-289c-454d-9bb3-811ffa21f6c7", "title": "", "query": "WITH ('4125, 4128') AS neodash_custom_01\nWITH apoc.text.replace(neodash_custom_01, '\\ ', '') AS atr\nWITH apoc.text.split(atr, ',') AS ats\nRETURN TOINTEGER(ats[0])\n\n\n", "width": 6, "height": 4, "x": 0, "y": 0, "type": "table", "selection": {}, "settings": { "actionsRules": [ { "condition": "Click", "field": "TOINTEGER(ats[0])", "value": "TOINTEGER(ats[0])", "customization": "set variable", "customizationValue": "ciao" } ] } }, { "id": "5c00f26f-84b4-4344-ab27-b9b6cf99a00f", "title": "", "query": "return $neodash_ciao\n\n\n", "width": 6, "height": 4, "x": 6, "y": 0, "type": "json", "selection": {}, "settings": {}, "schema": [] } ] } ], "parameters": {}, "extensions": { "active": true, "activeReducers": [], "query-translator": {}, "actions": { "active": true } } }
.
Can you send me the dashboard where you encounter the problem? On my side the parameter is an integer
Can you please send us the dashboard to test? Otherwise i will mark this as closed
Sorry for the delay, Alfredo, I'll get you a sample dashboard ASAP.
Alfredo,
Hopefully with this dashboard, you can see in the 3rd report that the TOINTEGER function is returning a value with a comma in it.
NeoDash_Integer_Sample-20240415.json
Please let me know if you need anything else, and thank you for your help!
@alfredorubin96 - Is there a status update for this bug? Thank you!
@nielsdejong - Is there a status update for this bug? Thank you!
@nielsdejong - Is there a status update for this bug? Thank you!
Hi, can confirm I have the same behaviour.
It seems to be based on the user's locale which formats the string.
My proposal is that we should have a global dashboard setting to handle formatting of number values and let people choose whether to use comma based, dot based, or simple formatting for large numbers.
Thank you, @nielsdejong! Do you intend for that global parameter to be able to let subsequent usage of that number as an integer? If so, that's perfect.
Thank you again!
Hi, can confirm I have the same behaviour. It seems to be based on the user's locale which formats the string.
My proposal is that we should have a global dashboard setting to handle formatting of number values and let people choose whether to use comma based, dot based, or simple formatting for large numbers.