Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Within a selected Dimention, How do I restrict the value to only show a selected items.
Colour | Name | country |
---|---|---|
Red | AAA | USA |
Blue | BBB | USA |
Yellow | CCC | UK |
Blue | DDD | USA |
Above example, I want to count total number of people in Country USA where Colour = Red or Blue
Thank you in advance.
Use set analysis or if condition in the count expression
Count({<Colour={'Red'},Colour={'Blue'} Name)
count(if(Colour='Red' or Colour='Blue',Name))
May be you can use wild-match in if statement and need to refine the one for set-analysis for correct syntax.
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.
just have a text box with this expression
=Count({1<Colour={'Red','Blue'}>} Name)
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
=Count({<Colour={'Red','Blue'},Country={'USA'}>}distinct Name)
Hi Ramkumar,
What is the 1 in the formula for?
What is a text box?
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
Lily can you post a sample.