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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to do a count on number of records in Excel file

Hi All,

I have an excel file with number of records which are not unique.

I am feeding them into Qlikview and need to do a count of records to show them in a table.

Problem:  I could not do an accurate count of the records under a filter condition.  It seem the count expression i use is wrong.  Below is the expression I am using for now.  Would appreciate if anyone has a direction on this.  Thanks!

Count({ 1<EOR_Program = {[Program_A]}>}EOR_Subject_Name)

1 Solution

Accepted Solutions
Not applicable
Author

Hi All,

I found out the mistake.  The screenshot of the data I took is in excel.  When uploading, I used crosstable format and the data structure changed in Qlikview. 

Upon looking at the preview of data in Qlikview, "EOR_Q1", "EOR_Q2" are changed from column to row.  This results in count been so high. 

To resolve this, I made the following expression:  Count({1<EOR_Subject_Name = {'Subject_A'}, EOR_Program = {'Program_A'}, EOR_Questions = {'Q1'}>} EOR_Subject_Name)

This result in correct count this time round.

Thanks to Herman for your contribution.  Your expression made me think again on the the problem reported. Thus, result in going directly to look into Qlikview data structure.

View solution in original post

7 Replies
swuehl
MVP
MVP

"It seems the count expression I use is wrong"

This does not help us to understand what the issue might be. Remember, we don't know your data, your model, nothing.

What do you get when using above expression?

What do you expect to get?

How does your data look like (best would be to post some sample data / a small sample app)?

Not applicable
Author

Hi Swuehl,

Thanks for pointing out the unknown factors.

Below are the information requested:

Count({ 1<EOR_Program = {[Program_A]}>}EOR_Subject_Name)

1.  What do you get when using above expression?

Response:  See screenshot, apparently it count the subject name which I assume this will also be the number of records.

Qns 2.jpg

2.  What do you expect to get?

Response:  I expect to get the number of records which should be equivalent to the number of subject name.

3.  How does your data look like (best would be to post some sample data / a small sample app)?

Response:  See screenshot below.  From the screen shot, I expect to get only 10 count based on the filters:  Program_A & Subject_A

Qns 3.jpg

Thanks in advance!

Not applicable
Author

Use this:

Count({ 1<EOR_Program = {'Program_A'}>}EOR_Subject_Name)

Not applicable
Author

It gave the same result as of above screenshot.

Not applicable
Author

Do you mind to upload a sample QVW ?

Not applicable
Author

Hi All,

I found out the mistake.  The screenshot of the data I took is in excel.  When uploading, I used crosstable format and the data structure changed in Qlikview. 

Upon looking at the preview of data in Qlikview, "EOR_Q1", "EOR_Q2" are changed from column to row.  This results in count been so high. 

To resolve this, I made the following expression:  Count({1<EOR_Subject_Name = {'Subject_A'}, EOR_Program = {'Program_A'}, EOR_Questions = {'Q1'}>} EOR_Subject_Name)

This result in correct count this time round.

Thanks to Herman for your contribution.  Your expression made me think again on the the problem reported. Thus, result in going directly to look into Qlikview data structure.

Not applicable
Author

You are welcome.

In fact, your requirement is very straight forward and should be easy to solve if we have all the information including sample source data and sample qvw.

Happy QViewing!