Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

List Box values change based on selection

Hi Qlik heads,

,

can you advise me on the below issue?, Issue is I have a table with Group and KPI as fields.

LOAD * Inline [

Group
CL
ED
HV
IE
SB
];
Join
A:
LOAD * Inline [
KPI
To
From
Country
];

whenever I open the application it should show KPIs "From" and "Country" with default selection as From and all the groups. then when I select "CL" in the list of groups,  KPI should show "To" and "country" and the group "CL".

Ideally, when I select groups other than "CL", KPI should show From and Country,  if the group is "CL" it should show "To" and "Country" , if the previous selection in KPI is "From", upon selection of "CL" group it should show "To" if it is country there shouldn't be any change in KPI selection.

PFA for the sample data.

tresesco‌;stalwar1;swuehl

Many thanks in advance!!!

1 Solution

Accepted Solutions
15 Replies
pooja_prabhu_n
Creator III
Creator III

Hi,

you can use field event triggers

settings --> document properties --> trigger -->Field Event Triggers.


Please refer the attached qvw file

Thanks,

Pooja

Anonymous
Not applicable
Author

Hello Pooja,

Thank you for the response, As I said the KPI list box should always show two values.

Also, always it has to show one selected value based on the conditions I have mentioned in my earlier post

Ideally, when I select groups other than "CL", KPI should show From and Country (it should not select both only one should be selected default is "From"),  if the group is "CL" it should show "To" and "Country" , if the previous selection in KPI is "From", upon selection of "CL" group it should show "To" if it is country there shouldn't be any change in KPI selection.

ahmar811
Creator III
Creator III

please consider below expression in your trigger

=if(Group='CL','("Country"|"To")',if(Group<>'CL','("Country"|"From")'))


I hope this will help you

Regards

Ahmar

Anonymous
Not applicable
Author

Hello Ahmar,

Thank you for your Response!!

You expression need a slit modification (removed double quotes)

=if(Group='CL','(Country|To)',if(Group<>'CL','(Country|From)'))

Also, my expected result is , when I open the application KPI has to show like

On Open:

when I select  Group "CL"  KPI has to show

when I return to other Groups it should show

Always the KPI has to show 2 values and one value has to be selected.

Also, when I select  Country and group CL it should show

if I select other than "CL" group I should see

in the above two screen shots you can see the change from "To" to "From" when the selection switched to non "CL" group to "CL" from Group.

I hope I have explained my issue bit better than earlier.

Thanks

ahmar811
Creator III
Creator III

I understand your requirement john.

Go to Seeting->Document Properties

You have to trigger on Document Event Triggers and Field Event Trigger refer below screenshot.

Capture.PNG

1-Document Event Triggers (OnOpen)

Capture2.PNG


2-Field Event Trigger (On Grop Field)

Capture3.PNG

=if(Group='CL','(Country|To)','(Country|From)')

Regards

Ahmar

Anonymous
Not applicable
Author

Thank you for your time Ahmar,

I tried the above methods but no luck , KPI object is selecting two values but I need only one value at a time, also KPI should not display 3 values (To, from Country) at any point od time it has to show two values (From, Country) or (To, Country)

sunny_talwar

Can you check if attached is working for you

Anonymous
Not applicable
Author

Thank you for looking into this mater Sunny,

it is not working as I expected,

EX:  when I clear Group field and try to select Country from KPI I am not able to select it. 

sunny_talwar

With triggers, it always very difficult to get all the things you want... but try now