Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Bar chart

Guys,

I have the data as shown below,

FieldCustomerID
AC11
BC22
CC13
DC21

Expected Output:

Screenshot_20.png

I want the no. of Fields which has same IDs. Both fields have same IDs but from different customers in the above bar chart.

1 Solution

Accepted Solutions
Highlighted
Champion II
Champion II

try below

sum(AGGR(if(Count({<Customer>}DISTINCT TOTAL <ID> Customer)>1,1,0),Field,Customer,ID))

To understand how its working do the below

Use ID as Dimension and below expression to count how many times the ID field is Repeated for different customer

=Count({<Customer>}DISTINCT  TOTAL  Customer)

So using

Count({<Customer>}DISTINCT TOTAL <ID> Customer)>1     << gives us the same view by ID field

View solution in original post

6 Replies
Highlighted
Champion II
Champion II

sum(AGGR(if(Count(DISTINCT TOTAL <ID> Customer)>1,1,0),Customer,ID))

Highlighted
Champion II
Champion II

Also you have close your earlier Thread!!

Qlik Community Tip: Marking Replies as Correct or Helpful

Highlighted
Creator III
Creator III

Thanks Vineeth, It's working.. but when I make a selection in Customer, there is no value in the chart. Could you please explain this expression in detail?

I couldn't understand it.

Highlighted
Champion II
Champion II

try below

sum(AGGR(if(Count({<Customer>}DISTINCT TOTAL <ID> Customer)>1,1,0),Field,Customer,ID))

To understand how its working do the below

Use ID as Dimension and below expression to count how many times the ID field is Repeated for different customer

=Count({<Customer>}DISTINCT  TOTAL  Customer)

So using

Count({<Customer>}DISTINCT TOTAL <ID> Customer)>1     << gives us the same view by ID field

View solution in original post

Highlighted
Creator III
Creator III

Thank you so much Vineeth. But I have one more doubt on this.

Assume instead of using this expression in charts directly (in run time), I store this expression in the script using SET or LET function in a variable.

Now could you tell me which method will take loading issues in the front end from below,

1. Writing expressions in the charts directly - first data will be fetched into the model and then the expression will be processed.

2. Store those expressions in the script using SET or LET functions - Expressions are processed and will be stored in memory.

please say which method is preferable and also please intimate whether above mentioned 2 points are correct.

Highlighted
Creator III
Creator III

Also Vineeth, I need to know whether this expression can be done as a dimension by script wise rather than an expression.