Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
chavanqlik
New Contributor III

Limit Dimension Based on the condition

I have a use case where I have to limit the dimension list based on user selection.

In the datamodel, there is a flag which will decide to display the "customer_id",

Flag column filed name: Grant, value: 'T'

I'm using this below expression, which is not working, it displays all the customers

For: aggr(only(${<[Grant]={'T'}>}customer_id),customer_id)

 

Please help me to resolve this issue

 

 

 

 

 

 

4 Replies
Channa
Valued Contributor III

Re: Limit Dimension Based on the condition

=only({<customer_id= {"=Grant = {'T'}"}>}customer_id)

try

if possible share sample app

Channa
chavanqlik
New Contributor III

Re: Limit Dimension Based on the condition

I got an invalid Dimension Error, 

Because of the privacy, I can't share the data, to simply.

Cutmore_id  Granted

  1001                    T         

  1002                    T

  1003                     -

  1004                    -

Just display

Cutmore_id

1001

1002

 

I want to remove 1003 and 1004 from the list,

 

I'm trying this one but still, I could see the "dontdisplay" in the table

 if(IsNull([Granted]),'dontdisplay',customer_id)

 

Hope it will give a high-level of informaiton. What I'm trying to achieve

 

 

Channa
Valued Contributor III

Re: Limit Dimension Based on the condition

use case statement

 

case when granted='t',customer

Channa
chavanqlik
New Contributor III

Re: Limit Dimension Based on the condition

I wrote the if condition because the case statement is not possible I guess in Chart functions

if(granted='t',customer_id,' some')

--Note The case or if the statement is not working, because I'm creating a new column beside the customer_id, and it will still display the else condition, if  I remove the "else" gives the blank

Cutmore_id  Granted    Testing 

  1001                    T           1001

  1002                    T            1002  

  1003                     -           some

  1004                    -             some

 

My goal is to achieve below table 

New table

Cutmore_id  cutomersaleGranter

  1001                    1001  

  1002                    1002