Usage of variable in error message

Post Reply
Jesh19
Posts: 8
Joined: Mon Sep 14, 2015 10:00 am
OLAP Product: Cognos TM1
Version: 10-2-0
Excel Version: 2013

Usage of variable in error message

Post by Jesh19 »

Hi,

I need to use a string value in my error message.
Let me explain the scenario.

I am having a cube with only 2 dimensions.
Organization and MaxHeadCount.

I am assigning some maximum headcount to each org.
So, in the form when the user enters the headcount more than maxheadcount, i am showing a error as 'Maximum Headcount Limit has exceeded.'

Now, the requirement is like i need to show the number in error message.
Let A(org) --> 120(MaxHeadcount)
and when user tries to enter headcount more than 120. It should prompt error message like "The headcount shouldn't cross 120".
How to pull this number into error message?


Thanks & Regards,
Jeshwanth
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Usage of variable in error message

Post by Wim Gielis »

In what interface does this happen ?
Excel / TM1 Web ? A TI process that is calculating / validating the input ?
A TM1 (string) rule in the Cube viewer ?
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Usage of variable in error message

Post by lotsaram »

So you need to convert a number to a string value.

Have you read the manual? It's all there. The intent of this forum is not to answer questions that can and should be quite easily answered wit a quick scan of the manual.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Jesh19
Posts: 8
Joined: Mon Sep 14, 2015 10:00 am
OLAP Product: Cognos TM1
Version: 10-2-0
Excel Version: 2013

Re: Usage of variable in error message

Post by Jesh19 »

I have got the solution.

Regards,
Jeshwanth
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Usage of variable in error message

Post by Wim Gielis »

Jesh19 wrote:I have got the solution.

Regards,
Jeshwanth
Thank you for the update. For users looking for answers rather than posting themselves, please add the solution you found.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Jesh19
Posts: 8
Joined: Mon Sep 14, 2015 10:00 am
OLAP Product: Cognos TM1
Version: 10-2-0
Excel Version: 2013

Re: Usage of variable in error message

Post by Jesh19 »

I have concatenated it with error message using CellGetS function.

For example:
My error message is 'Maximum Headcount has exceeded' and my value is some 50.
I wrote as follows:

'Maximum Headcount has exceeded' | CellGetS(Cube,dim1,dim2,value);

Regards,
Jeshwanth
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Usage of variable in error message

Post by Wim Gielis »

Let's add a few characters to make it somewhat more readable:

Code: Select all

'Maximum Headcount was exceeded: ' | CellGetS(Cube, dim1, dim2, value);
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply