Hi, Marimuthu.
For this tablematch to work, you need to have a numeric "Range" column in the source dataset and tablematch dataset. Did you meet that requirement?
Original Message:
Sent: Tue November 05, 2024 04:29 PM
From: Marimuthu Senthilkumaran
Subject: How to achieve this use case?
Hi Guillermo, Thanks for explaining this in much detail. This is really helpful and I followed your second option. Thanks again
= > < >= <= != | Use these operators with number columns. A comma can be used as an "or" operator. For example: =10,=20 can be read as "equal to 10 or equal to 20." A comma can be used as an "and" operator when enclosed in parentheses. For example: (>10,<20) can be read as "greater than 10 and less than 20." |
I also tried the first option with the brackets, but it didn't worked. Curious to understand why it is not working?
"TableMatch scans the rows sequentially" - Still not able to follow why it didn't worked.
Thanks again.
------------------------------
Marimuthu Senthilkumaran
Original Message:
Sent: Tue November 05, 2024 03:16 AM
From: Guillermo Cuadrado
Subject: How to achieve this use case?
Hello @Marimuthu Senthilkumaran
You can do it with a TableMatch() function call.
I had to tinker with the data a bit, as I couldn't get it to work as described in the help pages (link):
= > < >= <= != | Use these operators with number columns. A comma can be used as an "or" operator. For example: =10,=20 can be read as "equal to 10 or equal to 20." A comma can be used as an "and" operator when enclosed in parentheses. For example: (>10,<20) can be read as "greater than 10 and less than 20." |
I tried as in the example within brackets, but it didn't work. Then I remembered that TableMatch scans the rows sequentially, until it finds a match. So I prepared the following table. I called it Test Tablematch:
Range | Result |
<6 | with in 5 |
<16 | Between 6 to 15 |
<21 | between 16 to 20 |
* | Greater than 20 |
And created a test table with the following content:
Range |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
In the table, I added a simple formula step like so:
Result = TableMatch(Test Tablematch,Result)
This is what Apptio returned:
0 with in 5
1 with in 5
2 with in 5
3 with in 5
4 with in 5
5 with in 5
6 Between 6 to 15
7 Between 6 to 15
8 Between 6 to 15
9 Between 6 to 15
10 Between 6 to 15
11 Between 6 to 15
12 Between 6 to 15
13 Between 6 to 15
14 Between 6 to 15
15 Between 6 to 15
16 between 16 to 20
17 between 16 to 20
18 between 16 to 20
19 between 16 to 20
20 between 16 to 20
21 Greater than 20
Which, I believe, is what you were after. You may want to put some more rules to handle with other cases, such as there being a negative number, but you get the gist.
The TableMatch() function is a strange animal, in that you only pass the table name and the column you want the function to give you back. Also, you must ensure column name(s) match, i.e. the column holding the data in your table must match the one with the rules in the ancillary table.
You don't have to call Result the column that will hold the result of the function call, but I think it is clearer like this.
------------------------------
Guillermo Cuadrado
Senior Technical Management
Amadeus Data Processing GmbH
Erding
+491728696790
Original Message:
Sent: Mon November 04, 2024 04:54 PM
From: Marimuthu Senthilkumaran
Subject: How to achieve this use case?
Hi All,
This is a formula to identify something based on number range.
=if(x>0 AND x<=5, "with in 5", if(x>5 AND x<=15, "Between 6 to 15", if(x>15 AND x<=20,"between 16 to 20","Greater than 20")))
Can this be done using table approach in Apptio? instead of hardcoding the numbers in condition, Is there any way to keep it in table(like below) and find it using Apptio functions?
Please advise. Thanks in advance
Low | High | Return |
0 | 5 | with in 5 |
6 | 15 | Between 6 to 15 |
16 | 20 | between 16 to 20 |
21 | | Greater than 20 |
------------------------------
Marimuthu Senthilkumaran
------------------------------