Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikofba
Contributor II
Contributor II

Distinct Flag

Hi,

I have data below,

region      Customer    Color Blue Flag      Car


South            123                 YES                         1

South            123                 YES                         1

South            123                 YES                         1

South                   345           No                        1



I want this chart to be displayed as below


Region           Color blue     Car

South                     1                  2

How can i make expressions doing so? I have count(distinct Car) for the third column but am struggling with the second since the flag is 'Yes' I would like to try to use set analysis if possible.

THanks,

4 Replies
krishnacbe
Partner - Specialist III
Partner - Specialist III

Assuming you want the count of only Blue Color Car Count, below expression may help.

Count({<[Color Blue Flag] ={"YES"} >} Car)

vishsaggi
Champion III
Champion III

Try this?

Add a straight table

Dim: region

Expr1: = Sum( Aggr(Count(DISTINCT Car), region, Customer))

Expr:2 = Count(DISTINCT {< ColorBlue = {'Yes'} >} ColorBlue)

//Expr2: = Only({< ColorBlue = {'Yes'} >} ColorBlue)

Capture.PNG

qlikofba
Contributor II
Contributor II
Author

I am sorry, the last column is supposed to be customer, not car.

vishsaggi
Champion III
Champion III

Just use like

= Count(Distinct Customer)