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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

How to populate table data in table

Hi ,

I have two tables , having 100 columns each.

I  want a list box that would show the table names and when click on the table names , we need table data to be populated  in the straight table or Pivot table.

Could you please suggest how to get this done.

14 Replies
ashis
Creator III
Creator III
Author

Hi Sunny,

Lets take an example , i have two tables Sales and Customer. Now i have created one table name Table_to_show, there i have kept all the table names that are there in my data model.

Now i want to create a list box on Tables, that would list all the tables present , when when user click on the table name the data should be populated in straight table.

I do not want to add manually all the fields in the table in the dimension tab. ( because in the real scenario the columns are more so chances are more to do mistake) .

Could you please tell me how to get data populated with the help of $Field and $Table name.

Sales:

LOAD * INLINE [

    Country, Sale

    USA, 10000

    UK, 52220

    Germany, 69000

  

];

Customer:

LOAD * INLINE [

    Customer_id, Name

    1, Peter

    2, John

    3, Micheal

  

];

Table_to_show:

LOAD * INLINE [

    Tables

    Sales

    Customer     

];

Thank you,

Ashis

sunny_talwar

You don't need to create a table which lists all the names, QlikView already provides you these tables -> $Table, $Field. You can view them by checking 'Show System Fields' on the Fields tab of the Sheet Properties window

Capture.PNG

Now I am not fully sure how your chart is created, but I created two dimensions using the dollar sign expansion

=$(='[' & SubField(Concat($Field, '|'), '|', 1) & ']')

=$(='[' & SubField(Concat($Field, '|'), '|', 2) & ']')

Based on your selection in $Table, the dimensions will change

When Customer is selected

Capture.PNG

When Sales is selected

Capture.PNG

I have used 1 as expression and hide the expression from the presentation tab.

I understand that this might not be perfect, but since I don't really know the kind of straight table you are hoping to get, this is the best I can suggest until I know more.

ashis
Creator III
Creator III
Author

Thank you, I wanted similar thing like the one you did.

Regards,

Ashis Sau

ashis
Creator III
Creator III
Author

So if i have 100 columns in a table i need to create calculated dimensions using the same syntax for 100 times correct ?

=$(='[' & SubField(Concat($Field, '|'), '|', 1) & ']')

=$(='[' & SubField(Concat($Field, '|'), '|', 2) & ']')

.

.

.

=$(='[' & SubField(Concat($Field, '|'), '|',n) & ']')


sunny_talwar

Yes, unfortunately you will have to do that. Create this so that it can accommodate the max dimensions across all tables. So, for example if you customer have 2 and Sales have 3 columns, then you have to create 3 of them. In addition you have to make sure that the third dimension only shows when Sales is selected using enable conditions.