Vysh27
December 12, 2023, 10:12am
1
Hi , I want to show a percent symbol next to the numeric field of the dataset which also dynamically changes according to the decimal control I’ve created.
When I create a calculated field and adding it to the visual it’s taking as a string and it’s giving the count instead of the numerical number.
How do I change it so it gives me as a sum
Need help on this
ErikG
December 12, 2023, 10:18am
2
Hi @Vysh27
you are creating a string field that cant be summed up. Its like sum A and B.
But why not format/show the Sales
as Percent?
BR
Vysh27
December 12, 2023, 10:20am
3
when I try to format the sales as percent, the parameter that i’ve created to show the decimal points doesn’t work
How Can I make the parameter work by formatting the sales as percent?
ErikG
December 12, 2023, 10:25am
4
Other way around.
What do you want to achieve with the parameter and your sales field?
Can you share a sample?
Vysh27
December 12, 2023, 10:54am
5
As you can when I change the control to 2 the decimals in the numerical field also change to 2
ErikG
December 12, 2023, 11:14am
6
maybe you can have a look into
Thank you SO much @wstevens01 . That worked!
I just nested that into another ifelse to aoid the ‘%’ to still show up even if the conversion is not applicable. see below.
[image]
Final calculation:
ifelse(
isNotNull({CVR dyn. dec.}),
ifelse({CVR dyn. dec.} >= 10,
concat( split(toString({CVR dyn. dec.}), ".", 1), "%"),
concat( substring(toString({CVR dyn. dec.}), 1, 3 ), "%")
),
NULL
)
[image]
Vysh27
December 12, 2023, 11:28am
7
It’s still taking it as count and not showing the numbers according to the fixed decimal
ErikG
December 12, 2023, 11:54am
8
Because you still creating a sting and not a number.
Vysh27
December 12, 2023, 12:05pm
9
okay , but how was Gian able to achieve it as a sum and not count
Help me with this
ErikG
December 12, 2023, 12:14pm
10
Not sure he used sum or was looking on row level.
But i would say you will only achieve a sum if you format it instead of casting it into a string.
Vysh27
December 13, 2023, 9:21am
11
Any alternate way how I can Achieve what I want?
How Can I add the % symbol and Show it as a number and not count
ErikG
December 13, 2023, 9:26am
12
As I said only if you format the field that its keeps a numeric value.
Maybe you have to adjust the decimal parameter.
duncan
December 28, 2023, 5:43pm
13
Hello @Vysh27 !
Was @ErikG 's suggestion helpful, and if so could you mark their comment as a solution to help the community?
It has been some time since we have heard from you but we would still like to help you find a solution. If we do not hear from you in the next 3 business days this post will be archived.