Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimention restriction

Within a selected Dimention, How do I restrict the value to only show a selected items.

ColourNamecountry
RedAAAUSA
BlueBBBUSA
YellowCCCUK
BlueDDD

USA

Above example, I want to count total number of people in Country USA where Colour = Red or Blue

Thank you in advance.

11 Replies
sujeetsingh
Master III
Master III

Use set analysis or if condition in the count expression

Count({<Colour={'Red'},Colour={'Blue'} Name)

count(if(Colour='Red' or Colour='Blue',Name))

sujeetsingh
Master III
Master III

May be you can use wild-match in if statement and need to refine the one for set-analysis for correct syntax.

Not applicable
Author

Hi Sujeetsingh,

I've tried it, the result came back to only show the last value, in this case, only show where colour = Blue. not able to get both Red and Blue colour result. Help please.

Not applicable
Author

just have a text box with this expression

=Count({1<Colour={'Red','Blue'}>} Name)

PrashantSangle

Hi,

Try

Count({<Colour={"Red","Blue"}>}Name)

or

If you want to restrict dimension then

Create Straight table

add dimension as Calculated dimension

write

if(wildmatch(Colour,'Red','Blue'),Colour)

and check supress null Value in dimension tab

In expression tab

Write

Count(Name)            

or if you required distinct count then try with distinct

Count(Distinct Name)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sagarkharpude
Creator III
Creator III

=Count({<Colour={'Red','Blue'},Country={'USA'}>}distinct Name)

Not applicable
Author

Hi Ramkumar,

What is the 1 in the formula for?

What is a text box?

PrashantSangle


Hi,

     1. It represents the full set of all the records in the application.

and The $ sign represents the records of the current selection.

For more details go to help menu of qlikview App types Set Analysis.

You will get more information.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sujeetsingh
Master III
Master III

Lily can you post a sample.