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: 
Anonymous
Not applicable

Dynamic field in a checkbox

Hi,

I'd like to change a field in a Checkbox dynamicly. Actually, my task is to switch between Field1 (Brands) and Field2 (Advertiser). So, I base my Dynamic Checkbox on the following expression: =if ($(vChoice)=1, Brands, if ($(vChoice)=2, Advertiser)). It allows me to control the content of the Dynamic Checkbox by the value =1 or 2.

But it doen't wok properly. For instance:

Step 1: I set vChoice=1 and show Brands in the Dynamic Checkbox

Step 2: I select a brand, e.g. AUDI

Result: I see that not only brand AUDI but also some advertisers were selected. Why? Advertisers should not get selected if I select brands only.

Could you please say how I can set it so that brands and advertisers were selected seperately.

Please, see the file attached.

Larisa Filonova

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

No need to change your data model. Just do the following:

  • Create variable vDynamic
  • Change first button first action to change vDynamic to Brands
  • Change second button first action to change vDynamic to Advertiser
  • Change the dynamic list box expression to $(vDynamic)

See attached.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

7 Replies
sunny_talwar

your two tables are linked to each other on the field name Media. If you don't want selection of Brand to not impact Advertisers and vice versa you will have to break that link. You can try something like this may be:

brand_table:

LOAD [Media type] as [Media],   

     [Brand] as [Brands],

     [Cost RUB] as [Budget]

    

FROM

brand_data.xlsx

(ooxml, embedded labels, table is Лист1);

advertiser_table:

LOAD [Media type] as [Media1],

     Advertiser,

     [Cost RUB] as [Budget1]

FROM

advertiser_data.xlsx

(ooxml, embedded labels, table is Лист1);

in one of the tables call media type as Media1.

I haven't tested it, but I am almost certain this will help.

Best,

S

Anonymous
Not applicable
Author

The point is that I want Media to be a common field, that's why I don't want to rename it.

Let's imagine that two tables (brand_table and advertiser_table) must have a common field Media.

Then:

I see that it can work correctly in case of static checkboxes even if there is a common field.

Scenario 1:

Step 1: I create two static checkboxes (the first one is based on Brands field, the seconds one is based on Advertiser field)

Step 2: I select a brand and make sure that no advertiser has been simultaneously selected. That's right.

Scenario 2:

Step 1: I create a dynamic checkbox by the means of the following expression =if ($(vChoice)=1, Brands, if ($(vChoice)=2, Advertiser)).

Step 2: I select a brand in the dynamic checkbox and see that some advertisers have been simultaneously selected. That's wrong!

Maybe, I should set a dynamic checkbox not by the means of if statement but somehow differently?

See the file attached.

sunny_talwar

I get your point now. Let me see if I can figure that out.

Best,

S

buzzy996
Master II
Master II

try this way,

dimensionNodimensionLabeldimension
1Customer Name[Customer Name]
2ProvinceProvince
3RegionRegion
4Customer Segment[Customer Segment]
5Product Category[Product Category]

2. and use the folowing expression from ur UI,

Dimension info-

Used dimensions

=$(=only({$ <_dimensionNo={1}>} _dimension))

Enable Conditions

=SubStringCount(Concat(_dimension, '|'), '$(=only({$ <_dimensionNo={1}>} _dimension))')

Look might be complex,but it's very simple way to do,

create list box with _dimensionLabel,all ur fields are available.. slecte ur field dynamically from here,it will add auto matically to ur table.

buzzy996
Master II
Master II

TRY THIS,

THIS WILL WORK WITH VERSION 11 ON WORDS,

PLS ADD THESE CONDIONS ON UR DIMENSION TAB

Used dimensions

=$(=only({$ <dimensionNo={1}>} dimension))

Enable Conditions

=SubStringCount(Concat(dimension, '|'), '$(=only({$ <dimensionNo={1}>} dimension))')

Creat list box with dimesnionlable and presentation tab selection style over ride as LED check box.

Try to slect any brand from list box those changes we can see from ur chart object.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

No need to change your data model. Just do the following:

  • Create variable vDynamic
  • Change first button first action to change vDynamic to Brands
  • Change second button first action to change vDynamic to Advertiser
  • Change the dynamic list box expression to $(vDynamic)

See attached.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

I've got it. Thank you!