Mapped value in table

Hi, I'm trying to calculate a new column in a table based on the data in the table

For example, I want to create a rule that uses {{ currentSourceRow.url }}

If the url includes x, then the tag will be y in the column

The tag is u if z appears

As an example

If I add a new column to the table, how can I activate functions such as ifs?

Welcome to the forum!
Check out using ternary operators in a new column:
{{ currentSourceRow.url.includes('x')?'y':currentSourceRow.url.includes('u')?'z':''}}

now if i want to take it for the next level and build a function with weight for the parameters for example - if 100 followers is score one and 50 is score 0.5 - how do I function it to code to implement on the table?

Sorry, I don't follow. Can you nbe more specific? Is it something that is within the table already? screenshot?

I want to to calculate few parameters at once - for each of them have is own score for example:

Metrics Range Score Max score
Monthly views <100 0.3 1.75
Monthly views 100-300 0.5 1.75
Monthly views 300-500 0.6 1.75
Monthly views 500-700 0.7 1.75
Monthly views 700-1000 1.5 1.75
Monthly views 1000+ 1.75 1.75

now let's say with giving scenarios

Monthly views Followers Answers amont Topic Score
722 59 21 4 5.00
717 68 34 8 4.50

for example

OK so next questions:
So the Score is based on the Monthly views total i.e. 722 Monthly views equals a score of 1.5?

And, the first table is merely the rules
And, the second table is the one you want to display?

as an example

so something like the following
{{currentSourceRow.monthly_views <100?'0.3': currentSourceRow.monthly_views>=100 && <=300?'0.5'?currentSourceRow.monthly_views>300 && <=500:'0.6'?currentSourceRow.monthly_views>500 && <=700:'0.7'?currentSourceRow.monthly_views>700 && <=1000?'1.5'?currentSourceRow.monthly_views>1000?'1.75':''}}

1 Like