Formula - select value based on where clause

1.7k views Asked by At

I want to do a kind of localisation in Crystal Reports. For that I have defined the following table LANG:

Identifier    LocalisedText    LanguageCode
-------------------------------------------
1             Page             1
1             Seite            9
1             Pagina           13
2             Invoice          1
2             Rechnung         9

The fields Identifier and LanguageCode form my primary key.

Furthermore, I have a customer dataset table OCRD which has a field LangCode storing the language code for that customer. Thus, I joined LANG and OCRD based on the fields LanguageCode and LangCode. The screenshot below illustrates the join I have made.

Join between OCRD and LANG

Based on the join already performed by Crystal Reports I want to create a formula which performs the following action:

select LocalisedText from LANG where Identifier = 1;

However, I can't figure out how to do this with a formula. Is a formula even sufficient for solving my issue?

1

There are 1 answers

2
Siva On

You don't need formula what you need is adding the below code in Record Selection Formula

Go to Report -> selection Formula -> Record and write below code:

Identifier = 1;

and place the LocalisedText in details