# Right

The Join and Keep prefixes can be preceded by the prefix right.

If used before join it specifies that a right join should be used. The resulting table will only contain combinations of field values from the raw data tables where the linking field values are represented in the second table. If used before keep, it specifies that the first raw data table should be reduced to its common intersection with the second table, before being stored in QlikView.

Information noteWere you looking for the string function by the same name? See: [Right - script and chart function](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/StringFunctions/Right.htm)

Syntax:

Right (Join | Keep) [(tablename)](loadstatement |selectstatement )

Arguments:

Table load arguments

| Argument | Description |
| --- | --- |
| tablename | The named table to be compared to the loaded table. |
| loadstatement or selectstatement | The LOAD or SELECT statement for the loaded table. |

Example:

Example 1A

| Table1 | - |
| --- | --- |
| A | B |
| 1 | aa |
| 2 | cc |
| 3 | ee |

Example 1B

| Table2 | - |
| --- | --- |
| A | C |
| 1 | xx |
| 4 | yy |

`QVTable:` `SQL SELECT * 
 from table1;` `right join 
 SQL SELECT * from table2;`

Example 1C

| QVTable | - | - |
| --- | --- | --- |
| A | B | C |
| 1 | aa | xx |
| 4 | - | yy |

`QVTab1:` `SQL SELECT  * 
 from Table1;` `QVTab2:` `right keep 
 SQL SELECT * from Table2;`

Example 1D

| QVTab1 | - |
| --- | --- |
| A | B |
| 1 | aa |

Example 1E

| QVTab2 | - |
| --- | --- |
| A | C |
| 1 | xx |
| 4 | yy |

The two tables in the keep example are, of course, associated via A.

` tab1:  ` `LOAD * from 
 file1.csv;` `tab2:` `LOAD  * from 
 file2.csv;` ` .. .. ..  ` `right keep 
 (tab1) LOAD * from file3.csv;`

## Learn more

* [Join](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Join.htm)
* [Keep](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Keep.htm)
* [Inner](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Inner.htm)
* [Outer](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Outer.htm)
* [Left](https://help.qlik.com/en-US/qlikview/September2026/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptPrefixes/Left.htm)