Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
yvonne-c
Creator
Creator

Rangecount

I am having an issue getting rangecount to work

I am using the following expression to count incidences across multiple columns which gives me the results below

Sum(RangeCount(L1,L2,L3,L4,L5,L6,IA,IB,IC,M1,M2,M3,M4,M5,M6))

LesCount
OT5
-3
WLD2
BR1
Total11

It works fine until there are more than one 'Les' on a row -  then they are totalled on the '-' row.

I want to count each 'les' individually so the results should be as follows

LesCount
OT5
WLD3
BR2
IB1
Total11

An example of my data is attached

Any ideas?

Thanks

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I would use the following Load statement to load the data. This will define a field called "Les".

Crosstable (Column,Les)
LOAD
RecNo() as ID,
L1,L2,L3,L4,L5,L6,IA,IB,IC,M1,M2,M3,M4,M5,M6
FROM [example.xlsx]
(
ooxml, embedded labels, header is 1 lines, table is Sheet1);

Then I would create a chart with "Les" as dimension and Count(ID) as expression.

Image1.png

HIC

View solution in original post

6 Replies
hic
Former Employee
Former Employee

How is "Les" defined? I suspect that the definition is made so that NULL is returned when there are several values.

HIC

yvonne-c
Creator
Creator
Author

Les is a dimension

hic
Former Employee
Former Employee

Yes of course it is. But how is it defined? What formula have you used?

yvonne-c
Creator
Creator
Author

Sorry I'm not sure what you mean!

My list of 'Les' are stored on a separate table?

hic
Former Employee
Former Employee

I would use the following Load statement to load the data. This will define a field called "Les".

Crosstable (Column,Les)
LOAD
RecNo() as ID,
L1,L2,L3,L4,L5,L6,IA,IB,IC,M1,M2,M3,M4,M5,M6
FROM [example.xlsx]
(
ooxml, embedded labels, header is 1 lines, table is Sheet1);

Then I would create a chart with "Les" as dimension and Count(ID) as expression.

Image1.png

HIC

yvonne-c
Creator
Creator
Author

Thanks, that's worked for me