Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Space_Error

Hello Community,

I need a clarification  on this

Table which contains field name and field-values(tables which are already exists in mdb) are respectively

Tablename and  Orders,...,Odrer Details

My script was follows as like this

LOAD * INLINE [

    Tablename

    Orders

    Customers

    Products

    Categories

    Divisions

    Shippers

    Shipments

    Order Details

    ];

LET Vtablecount=FieldValueCount('Tablename');

For i=1 to $(Vtablecount)

Let Vtable=FieldValue('Tablename',i);

SQL SELECT *

FROM $(Vtable);

NEXT

Everything is fine here

But I was unable to load a single table name as Order Details dynamically due to it has space .

even though i was tying also this

SQL SELECT *

FROM [$(Vtable)];

Can anybody help me in this if knows.

Thanks in advance

Regards

Sattish.

7 Replies
Anonymous
Not applicable
Author

Not sure this is correct

use [Order Details]

Not applicable
Author

But we can't

Miguel_Angel_Baeyens

Hi,

Use instead:


FROM '$(Vtable)';


Miguel

Not applicable
Author

No use.

Miguel_Angel_Baeyens

I'm assuming that "Order Details" is a valid database table name, since you have not specified otherwise.

If you use your SQL Query tool, can you select from "Order Details" with space? In postgres, for example you need the character "`" (grave tilde) when the name of the table or field has something else than azAZ (underscores, points, etc).

Make sure that your data source (your MDB) has the table stored with space and that you can do the query manually.

I have created a sample test in my laptop and works fine.

Moreover, make sure that the loop is populating the variables as you expect.

Miguel

Not applicable
Author

Yes manually it was working fine.

But i want to retrieve the all the tables dynamically(which all are tables exists in MDB) irrespective of any space.

See below this is one more scenario for your reference.Creating QVD's through Binary load irrespective of any space.Here no issues it was working fine.

Binary d:\practice\workbook\bkp\qv_training.qvw;

SET Vbinqvdpath=D:\Others\Bin\;

Let Vbinumtab=NoOfTables();

FOR i=0 to $(Vbinumtab)

Let Vtable=TableName(i);

STORE [$(Vtable)] into  $(Vbinqvdpath)[$(Vtable).qvd](qvd);

NEXT

Regards,

Sattish G

Miguel_Angel_Baeyens

So I was right, the grave tilde works (see attached).

Miguel