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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

get data filtered in pivot table

hi, i found a great tutorial from [Building a nicer (dynamic) multibox, without extensions]

http://www.qlikfix.com/2014/07/08/building-nicer-dynamic-multibox/

i was able to use it, and i really love it.

but i have an issue.

if i use multibox with master detail table, then i filtered it from detail then master will automatically selected.

how i can achieve this.

in label i use "=if(IsNull(GetFieldSelections(master)) = -1, 'Master',GetFieldSelections(master))".

with this script i can set 'Master' as label.

i see data has filtered but i didn't find function to get data that has been filtered to set it in label, maybe someone here can give me an advice to solve this.

thank you.

1 Solution

Accepted Solutions
Not applicable
Author

at least i can get what i want, it's so simple. never thought if i call the field will show the data that has been filtered. this is my new code placed in label.

=if(IsNull(GetFieldSelections(country)) = -1, if(Count(country) = 1, country, 'Country'),GetFieldSelections(country))

thank you sunindia.

View solution in original post

5 Replies
sunny_talwar

May be this instead:

If(Len(Trim(GetFieldSelections(master))) = 0, 'Master', GetFieldSelections(master))

Not applicable
Author

hi sunindia,

thank you for your response.

code that i give is working fine.

what i trying to achieve is get the name master that has filtered by detail.

for example :

table master

idmaster  name

1   italy

2   japan

3   england

table detail

idmaster  iddetail     name

1               1           venice

1               2           milan

2               1           osaka

2               2          kyoto

3               1          birmingham

3               2          london

in multibox detail when i select kyoto then multibox master will automatically show japan .

how to do this in custom multibox (pivot table) . the reference for create multibox from pivot table in the link that i provided.

thank you

sunny_talwar

If instead of calling both name as name, you call one of them country_name and other one as state_name then I think you can create two list boxes or two rows in your multibox, one for country_name and other one for state_name. As soon as you make a selection in state_name, it will automatically show that the only option available within country_name is the one it belongs to.

for example :

table master

idmaster  country_name

1  italy

2  japan

3  england

table detail

idmaster  iddetail    state_name

1              1          venice

1              2          milan

2              1          osaka

2              2          kyoto

3              1          birmingham

3              2          london

Is this what you are kind of looking to do?

Best,

Sunny

Not applicable
Author

this is what i trying to do.

get_filtered_like_multibox.jpg

from the picture at top you can see a multibox, and at the bottom is custom multibox using pivot table.

if using multibox, when select state 'milan' --> country will automatically select italy.

but not happen when use pivot table.

how to resolve this.

thank you ..

best regards

Not applicable
Author

at least i can get what i want, it's so simple. never thought if i call the field will show the data that has been filtered. this is my new code placed in label.

=if(IsNull(GetFieldSelections(country)) = -1, if(Count(country) = 1, country, 'Country'),GetFieldSelections(country))

thank you sunindia.