Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How can i load or get all table columns in one field and...?

Hi,

i load a table like this


ProductSalesSales TargetOnlineOnline Target
Bananas12020080150
Socks3001000200700

Now i want to create a field where i can select:

Show Sales

Show Online


In the dashboard i use this field and create a (only one) table wich should be dynamic:


[Select Field] -> Show Sales is selected and shows


ProductSalesSales Target
Bananas120200
Socks3001000


[Select Field] -> Show Online is selected and shows


ProductOnlineOnline Target
Bananas80150
Socks200700


What is the best practice for this?


I dont´t want to get the columnnames for a new field in a static manuell way, i prefer a dynamic one. Because the columns can change.

I think i can use the data from the loaded table and put the fields to a new field like this?!

Load

Sales & Sales Target as Show Sales

Online & Online Target as Show Online

from resident...


But is there a way that the names of the new fields are created automaticly according to a pattern?


Load

{columnnames with the same first word} as Show + {the first word before whitespace}

from resident...

So the script should load

Product as Show Product

Sales Target + Sales as Show Sales

Online + Online Target as Show Online


regards,

sam

1 Reply
OmarBenSalem

Keep your table as it is, then add a new Inline table as follow:

load * Inline [

ShowID, Show

1, ShowSales

2, ShowOnline

];



Now put your new Show field as a slection list :

Now in your table have 3 dimensions :

1) Product :

2) =pick(ShowID, 'Sales ='&Sales, 'Online ='& Online) : name it Actual

3) =pick(ShowID, 'Sales Target ='&[Sales Target], 'Online Target ='& [Online Target]) : name it Target

And now dpends of your selection in the Show field, the result would be ;

Capture.PNG

Capture.PNG