Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld online is next week! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
h_demarco
Contributor III
Contributor III

Straight table dimension filter based on other field

Hello,

I have a straight table with a dimension CUSTOMER_CODE. For some CUSTOMER_CODE I also have a GROUP_NAME, but not all of CUSTOMER_CODE are part of some GROUP_NAME.

What I need is:

-if user selects a GROUP_NAME, all CUSTOMER_CODE of this GROUP_NAME should appear in the straight table.

-if user selects a single CUSTOMER_CODE and it is part of a GROUP_NAME, all CUSTOMER_CODE of this GROUP_NAME should appear in the straight table.

-if user selects a single CUSTOMER_CODE and it is NOT part of a GROUP_NAME, only one row will be shown in straight table (the row of selected CUSTOMER_CODE).

Exception: if user select more than one CUSTOMER_CODE and/or more than one GROUP_NAME, I've already set a custom error message.

Maybe relevant: CUSTOMER_CODE and GROUP_NAME are in the same table CLIENTS.


Any idea on how to make this?

Thank you in advance.

Henrique

1 Solution

Accepted Solutions
ogautier62
Specialist II
Specialist II

Hi,

you could achieve this with action in document :

action 1 on selection field customer_code :

                 select in field group_name the value : only({<group_name = P({$} customer_code) >} group_name)

action 2 on selection field customer_code :

                 deselect field value  : = if(count(group_name)>0,'customer_code')

it should do what you want

regards

View solution in original post

3 Replies
ogautier62
Specialist II
Specialist II

Hi,

you could achieve this with action in document :

action 1 on selection field customer_code :

                 select in field group_name the value : only({<group_name = P({$} customer_code) >} group_name)

action 2 on selection field customer_code :

                 deselect field value  : = if(count(group_name)>0,'customer_code')

it should do what you want

regards

h_demarco
Contributor III
Contributor III
Author

Olivier,

I did some changes on requirements and created a button to execute actions suggested by you.

Thanks for your help.

Henrique

ogautier62
Specialist II
Specialist II

thanks Henrique,

good dev