Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL alias for tables in QlikView

Hi guys,

I am trying to dig into SQL a little bit, and I have noticed, that when I try to name a table in QlikView, using only SQL, then it doesn't rename the chosen table. My code for this is:

Select *

From FilteredAccount as Partners;

FilteredAccount is the table I want to query, and I want to rename it to Partners. But after Reloading, both in the UI (by creating table box) and in the table viewer, I see FilteredAccount as table name. Has anyone encountered this before?

Thanks for the answers!

BR

T

1 Solution

Accepted Solutions
marcus_sommer

Like above described this won't work - you need to name your tables explicitly within the qlikview-part not within the sql-part.

Further by many sql-tables might be a rename-statement per mapping helpful.

- Marcus

View solution in original post

13 Replies
vikasmahajan

Before this

Select *

From FilteredAccount as Partners;

Give following command

Yourname:

Select *

From FilteredAccount as Partners;

HTH

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
HirisH_V7
Master
Master

Hi,

Assigning the local name For the Table will help to transform data .

Hope this helps.

HirisH
“Aspire to Inspire before we Expire!”
Not applicable
Author

Thanks Vikas,

it works. But can I do the renaming only by modifying the SQL part? In theory (from materials found on the web) the line FROM FilteredAccount as Partners; should rename the table, but it doesn't.

Thanks,

Tibor

vikasmahajan

Yourname:

Load

  filed1  as < Column Name> ,

  filed2  as < Column Name> ,

  filed3  as < Column Name>

Select *

From FilteredAccount as Partners;

Like this presiding load you give names to columns.

HTH

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

Hi,

it's interesting, because renaming columns like you have mentioned works just fine...where I bump into a problem is renaming  tables...

Br


Tibor

vikasmahajan

Why you want to rename table name ? Is there specific requirement ?

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

I am just experimenting with SQL, and it is really interesting, that many things can be done in QlikView with SQL, but this basic thing, like renaming table, doesn't.

Tibor

jagan
Luminary Alumni
Luminary Alumni

Hi,

You can rename the SQL table by giving alias, but you need to manually rename the Qlikview TableName.

Try like below

QVTableName:

Select *

From FilteredAccount Partners;

Instead of default table name, it is suggestible to manually give the Qlikview table name, it is a good practice.

Hope this helps you.

Regards,

Jagan.

marcus_sommer

I think the reason is that the sql-query runs inside a kind of "container" which isn't really effected from the sql-statement itself. This meant, at first qv creates a table which get without an explicit written table-name above the sql-statement the (last part) from the database-tablename and then this qv table will be filled with the responses from the sql-query.

QV let the complete sql-statement untouched - it's only transferred to the odbc/oledb-driver. This meant a classical sql-statement which gives tables names like:

...

ABC as a

     LEFT JOIN

XYZ as b

ON a.ID = b.ID;

are working without problems.

- Marcus