Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
wuming79
Creator
Creator

Qilksense: Count with consideration on multiple columns

Hi,

I have the following table below:

MonthClassFruits
JUN2Apple
JUN4Orange
JUN6Banana
JUN2Pear
JUN4Pear

I want to make a table that shows as below:

MonthTotal Fruits that is Class 2 and 4
JUN3
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

you can use

count({<Class={"2,4"}>}distinct Fruits)

View solution in original post

5 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

you can use

count({<Class={"2,4"}>}distinct Fruits)

Anil_Babu_Samineni

Try this, If this is in script


Table:

Load * From Table;


Final:

Load Month, Count(Fruits) as [Total Fruits that is 2 and 4] Resident Table Where Match(Class, 2,4) Group By Month;

If Design, you may try like below?

count({<Class={"2,4"}>} Fruits)


Or

Count(If(Match(Class, '2','4'), Fruits))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
wuming79
Creator
Creator
Author

I got invalid dimension

Anonymous
Not applicable

Add it as a measure

wuming79
Creator
Creator
Author

I got it working now. Thanks!