Skip to main content
Question

Save Table Aliases and use in formulas?

  • June 26, 2023
  • 0 replies
  • 111 views

Hi all,

Can I save the table alias in a field and then use that value in a formula?

Example is a field in the table that identifies another table where I will lookup a value.

This works, the table alias is _DBID_UTILITY_MATRIX

GetRecords("{query}", [_DBID_UTILITY_MATRIX])

This doesnt work

GetRecords("{query}", [Calc Table Name])

Where [Calc Table Name] is a text field with value = [_DBID_UTILITY_MATRIX]

Either [_DBID_UTILITY_MATRIX] or "_DBID_UTILITY_MATRIX"  Any ideas?

My fallback is to create a series of case statements with the alias hardcoded like this

Case([Calc Table Name],"table 1",GetRecords("{query}", [_table_1],

"table 2",GetRecords("{query}", [_table_2],

"table 2",GetRecords("{query}", [_table_2])

Gerry



------------------------------
Gerry Munroe
------------------------------

This topic has been closed for replies.

Hej Gerry!

Question, why are you planning to use the table alias instead of the ID?

Something like:

GetRecords("{3.GT.0}", "bck7gp3q2")

Back to the question, you might try saving the text string as '_DBID_UTILITY_MATRIX' and then call the field. However I've never seen the table alias used in the GetRecords function.

Will give it a shot from my side and let you know if it works :)



------------------------------
Lordsman Burgos
------------------------------

Just tried it from my side and it seems like it works. I'm trying this formula:

SumValues(GetRecords("{1211.TV.'"&[Adviser_2]&"'}AND{2723.LTE.1}AND{2716.EX.1}",[AliasTest2]), 2716)

Where the AliasTest2 field, is a Formula - Text set to 

[_DBID_DEVTEST]

Let me know if you keep encountering issues, but from here, seems like your method should work OK!



------------------------------
Lordsman Burgos
------------------------------