Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How can I add Column names of data (from which a chart is created) as items of list box.

Hi Everyone,

Got terribly stuck with a situation. I have a data-set in excel in the following format:

     

DateCoalHydroSolarWind
1-Jan-17130250336404
1-Feb-17128219327423
1-Mar-17156287375454
1-Apr-17133253389452
1-May-17171253305469
1-Jun-17138251347430
1-Jul-17191279312474

I have created a stacked Bar chart out of this data, with each field (i.e. Coal, Hydro, Solar & Wind) appearing in different colors. Now I would like to have a list box with all these 4 field names. And once, I select a particular fueltype, the bar chart only displays data for that particular fuel. Thanks a ton for your help in advance.

7 Replies
antoniotiman
Master III
Master III

Hi Anand,

See Attachment.

Regards,

Antonio

Anonymous
Not applicable
Author

thank you very much Antonio for this as it is very helpful. Couple of questions here:

1. Under the Expressions - -> Conditional Check Box you have entered a formula as: SubStringCount(Concat(Fuel,' '),'Coal'). What does this mean here and what is the condition based on the count of fuel type occurrence?

2. In the inline statement, you have mentioned:

LOAD * Inline [

Fuel

Coal

Hydro

Solar

Wind];

Does it mean that Inline table created can be referred by the first entry, i.e. 'Fuel' anywhere (like you have used it in Listbox Field?

Thanks again, Anand

antoniotiman
Master III
Master III

Hi Anand,

1) Condition is : text 'Coal' is in the selected Field/s Fuel.

2) 'Fuel' is Field Name. Colar,Hydro,Solar,Wind are values of Field 'Fuel'

Regards,

Antonio

Anonymous
Not applicable
Author

Thanks for your prompt reply Antonio. and sorry to be naive there, but I thought SubStringCount(Concat(Fuel,' '),'Coal') function will return a number "1" in this case as coal would be appearing once in the list. How does 1 here translates to that the condition is met? Does 1 or any value more than 1 signifies 'TRUE' here? thanks, Anand

antoniotiman
Master III
Master III

More specifically   condition is   0    or    <> 0

antoniotiman
Master III
Master III

Just as if You wrote

=If(SubStringCount(Concat(Fuel,'|'),'Coal') > 0,1,0)

Anonymous
Not applicable
Author

sure thing Antonio. thanks a ton for the explanation. anand