Calculated field as string

I have a calculated field, where the result is a string (AAA or AA or BBB or BB or CCC or CC).
I need to show this result in a single large visual, similar to this:
image

Hi @alanwutke - Can you please explore adding insight functionality for this requirement.

Hi @duncan - Any expert advise from your side.

Regards - Sanjeeb

2 Likes

Can you give me some examples of how to do it, as I’ve already made several attempts using insights, but every time I get an error.
image

@alanwutke can you share your sample data?

I also can’t imagine what will be the value of the max() operation on a bunch of text values, if that’s what you are trying to do.

1 Like

Hello @neelay
This is the calculated field that generates the ratings:

ifelse(
{calc_score_finan} >= 95 AND {calc_score_finan} <= 100, ‘AAA’,
{calc_score_finan} >= 90 AND {calc_score_finan} <= 94, ‘AA’,
{calc_score_finan} >= 85 AND {calc_score_finan} <= 89, ‘A’,
{calc_score_finan} >= 75 AND {calc_score_finan} <= 84, ‘BBB’,
{calc_score_finan} >= 65 AND {calc_score_finan} <= 74, ‘BB’,
{calc_score_finan} >= 50 AND {calc_score_finan} <= 64, ‘B’,
{calc_score_finan} >= 30 AND {calc_score_finan} <= 49, ‘CCC’,
{calc_score_finan} >= 20 AND {calc_score_finan} <= 29, ‘CC’,
{calc_score_finan} >= 10 AND {calc_score_finan} <= 19, ‘C’,
‘D’
)

Next, I want to show just the ranking, just like this example:

image

@alanwutke I am looking for the dataset… does it have 1 row or multiple rows?

1 Like

The dataset has several rows.
The result of the calculated field calc_classificacao_total is the same for all lines, depending on the filter applied.

Hi @alanwutke,

You can try a bottom ranked or top ranked insight. Just set the number of results to 1 (default is 3) and format the text as needed.

For example, I can show a product name like this in a bottom/top ranked insight:

I’ve already tried running it this way, but the same errors occur:


It’s as if there was something wrong with the calculated field, I can’t use its data in insight

Maybe calculated fields are not supported in insights. Can you try to move the calculation to your dataset?

2 Likes

Got it, I’m going to change the calculated fields to the dataset.
I haven’t done this test yet.
I bring news.
Thank you for now.

I created the fields directly in the dataset and used them in insights, but the error remains :sob: :sob::

Can you show the calculated field that you’re using in the Values field well? Just for troubleshooting, try to put a different field in the Values field well and see if it still gives you the error.

1 Like

@alanwutke The calculated field you have is a row-level calculation. You can simply filter for the corresponding dimension at the row level and show only the value in a a single-cell table like this:

Would it help?
GL

1 Like

Thanks for the answer @gillepa
I have already managed to show it as a Single Table, but it is not visually as expected by the client, who wants larger letters.
I’m trying to create the calculated fields that generate the classification as a calculated field in the dataset, and then try to use the insight.

Sorry for the delay in responding @David_Wong
Below are the 2 calculated fields that I am creating in the dataset.


calc_score_finan_1

sumOver(
sum(peso),
[${data}]
)

calc_classificacao_financeiro_1

ifelse(
{calc_score_finan_1} >= 95 AND {calc_score_finan_1} <= 100, ‘AAA’,
{calc_score_finan_1} >= 90 AND {calc_score_finan_1} <= 94, ‘AA’,
{calc_score_finan_1} >= 85 AND {calc_score_finan_1} <= 89, ‘A’,
{calc_score_finan_1} >= 75 AND {calc_score_finan_1} <= 84, ‘BBB’,
{calc_score_finan_1} >= 65 AND {calc_score_finan_1} <= 74, ‘BB’,
{calc_score_finan_1} >= 50 AND {calc_score_finan_1} <= 64, ‘B’,
{calc_score_finan_1} >= 30 AND {calc_score_finan_1} <= 49, ‘CCC’,
{calc_score_finan_1} >= 20 AND {calc_score_finan_1} <= 29, ‘CC’,
{calc_score_finan_1} >= 10 AND {calc_score_finan_1} <= 19, ‘C’,
‘D’
)

Hey @alanwutke !

Were you able to find a solution for this and if so could you share your solution with the community?

Good morning @duncan ,
Sorry, I ended up forgetting to share, but yes, the solution was to create the fields to use in insights before Quicksight, in this case using python+pandas.
This way it worked.

1 Like