Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Before this
Select *
From FilteredAccount as Partners;
Give following command
Yourname:
Select *
From FilteredAccount as Partners;
HTH
Vikas
Hi,
Assigning the local name For the Table will help to transform data .
Hope this helps.
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
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
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
Why you want to rename table name ? Is there specific requirement ?
Vikas
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
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.
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