Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings:
I am having a very basic problem for which I did not find any answers online:
I need to convert numbers into their scientific notation, that I can tailor with the right number of decimals. In other words and for example:
Turn
1,867,343,087 into 1.87e+9
or 1,123 into 1.1e+3
What is the syntax that
Thank you for your help.
Can
Hey there,
Does this satisfy things?
Source data:
[table]:
LOAD * INLINE [
values
1003
99035
112341235
];
One Decimal Expression:
=left([values],1) & '.' & Right(Left([values],2),1) & 'e+' & (len([values])-1)
Two Decimal Expression:
=left([values],1) & '.' & Right(Left([values],3),2) & 'e+' & (len([values])-1)
Strictly speaking it doesn't satisfy the rules of scientific notation since you'd want the 2nd digit to not be 0 if my memory of this in high school is accurate!
Hi.
Thank you for your quick answer.
The creation of a new variable in the editor, according to your suggestion, works perfectly when I display value in a table ...
... but it does not work in a chart; it still displays it with a regular numbers format. I tried to apply your formula on a measure too. Still returns the non-scientific notation ... It seems that the chart only understands the format pattern box
How are you planning on visualizing this data? Because you can always wrap things in =text() and declare it in the script:
[table]:
LOAD * INLINE [
values
1003
99035
112341235
];
[table2]:
NoConcatenate
LOAD
*,
Text(left([values],1) & '.' & Right(Left([values],2),1) & 'e+' & (len([values])-1)) AS OneDecimal,
Text(left([values],1) & '.' & Right(Left([values],3),2) & 'e+' & (len([values])-1)) AS TwoDecimal;
LOAD
*
RESIDENT [table];
DROP TABLE [table];
Using exactly the same variable ...
Cannot use text, because it will not plot
You could try to use:
dual(CustomizedScientificNotation, pure numeric value)
as expression.
- Marcus