DB inside DB
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
DB inside DB
Hi,
I am trying to use DB inside DB and I do not have any idea why is not working.
Find attached the screenshots to show the problem.
Can anybody please give me a insight of what could be wrong?
Thanks in advance,
JR
I am trying to use DB inside DB and I do not have any idea why is not working.
Find attached the screenshots to show the problem.
Can anybody please give me a insight of what could be wrong?
Thanks in advance,
JR
- Attachments
-
- Doubt.docx
- (314.18 KiB) Downloaded 426 times
-
- 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: DB inside DB
Your mistake is probably that "Agente - AB e TO" is not the same as "Agente - AB" (see the first nested DB() ). Unless it's an alias.
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
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
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
Hi Wim,
It is an alias and I also have tested both DB's and the problem is on the second.
If I use this second DB alone it works. But when it is inside another one I have a problem.
I really don't have idea of what is happening, unfortunately.
It is an alias and I also have tested both DB's and the problem is on the second.
If I use this second DB alone it works. But when it is inside another one I have a problem.
I really don't have idea of what is happening, unfortunately.
-
- 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: DB inside DB
Don't you have an issue with numbers and strings ?
Elements in a dimension are always strings, even when they look like numbers.
Elements in a dimension are always strings, even when they look like numbers.
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
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
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
I am using they like numbers but it should be string? I didn't knew this. I will fix it and try again.
Tks.
Tks.
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
It doesn't work. I set the metric as string and it was impossible to do the rule because it is a string.
Then I have changed to string the numbers of the source cube and not worked either.
Then I have changed to string the numbers of the source cube and not worked either.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: DB inside DB
Dimension elements are always strings, regardless of the actual characters used in their names. If you are going to write a DB formula to pull back a value from a cube in order to substitute it for an element name in another part of a formula the value you are pulling back must always be a string.
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: DB inside DB
As the guys are alluding to; you need to wrap an STR function around the DB.
Declan Rodger
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: DB inside DB
All the arguments in a DB formula must be strings. If the value pulled back from this DB:Jorge Rachid wrote:It doesn't work. I set the metric as string and it was impossible to do the rule because it is a string.
Then I have changed to string the numbers of the source cube and not worked either.
DB('Volume', !Produtos, !Operacoes, !Itens de Faturam, !Meses Ano, 'Agente -AB')
is not a string then your rule will not work, Time to go back to the drawing board and figure out another strategy.
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
But what happens in the case like mine where the element is calculated? How can I use as string if I have some calculations?
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: DB inside DB
Declanr already gave you the answer. Use the STR function to convert it to a string.
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
I did but still not working.
The DB now it is like this:
['Preço - PA'] = N:
DB('Tabela Preco PA'
, DB('Volume', !Produtos, !Operacoes, !Itens de Faturamento, !Meses Ano, 'Agente - AB')
, STR(DB('Volume', !Produtos, !Operacoes, !Itens de Faturamento, !Meses Ano, 'Taxa Ocupação Ajustada'),3,2)
, '51-100'
, 'Preço');
And the cube where I get the information keep as number.
Is that correct?
The DB now it is like this:
['Preço - PA'] = N:
DB('Tabela Preco PA'
, DB('Volume', !Produtos, !Operacoes, !Itens de Faturamento, !Meses Ano, 'Agente - AB')
, STR(DB('Volume', !Produtos, !Operacoes, !Itens de Faturamento, !Meses Ano, 'Taxa Ocupação Ajustada'),3,2)
, '51-100'
, 'Preço');
And the cube where I get the information keep as number.
Is that correct?
-
- 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: DB inside DB
Did you right-click the calculated cell and choose "Trace calculation" ?
Seems obvious to first use the tools available to you to see what is going on.
Seems obvious to first use the tools available to you to see what is going on.
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
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
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
Yes and the only thing that I can see it is zero for this second DB.
-
- 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: DB inside DB
What about the decimal separator ?
Did you create an addition string measure in the / a cube, to only test the STR( DB( )) part ?
If that still gives you the wrong result, please hardcode parts in the formula(s) until you get it working.
After that, bring in the formulas / functions again instead of hardcoded elements.
Did you create an addition string measure in the / a cube, to only test the STR( DB( )) part ?
If that still gives you the wrong result, please hardcode parts in the formula(s) until you get it working.
After that, bring in the formulas / functions again instead of hardcoded elements.
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
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
-
- Posts: 113
- Joined: Fri Jul 22, 2016 8:33 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2013
Re: DB inside DB
Hi,
Now it is working.
When I use the STR function the number is not 1,95 anymore but 1.95.
So on destination cube I changed the values of dimension and now the DB works.
Sorry and thanks so much!
JR
Now it is working.
When I use the STR function the number is not 1,95 anymore but 1.95.
So on destination cube I changed the values of dimension and now the DB works.
Sorry and thanks so much!
JR
-
- 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: DB inside DB
That's indeed what I meant with checking the decimal separator.
Glad that it's working now !
Glad that it's working now !
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
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