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: 
Not applicable

Row Count

Hi,

I am a novice and trying to get a row count using the expression below:

=Count({$<Scheduled_Month={$(=(Month))}>}Scheduled_Month)

Here, column Scheduled_Month is in Table XYZ and column Month is in table ABC. XYZ and ABC have no relation.

I am trying to get the row count from table XYZ for a particular Scheduled_Month whose value equals to a static value in column Month of ABC.

Please let me know what is wrong with the above expression?

Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I see what you mean.  And I see that I attached wrong file, sorry.

Take a  look at the attached now.  You don't need set here, the expression is using if() function

View solution in original post

5 Replies
Anonymous
Not applicable
Author

This expression will work only when one Month is selected.  Is it what you want?

Edit: attached an example as you described it.

iktrayanov
Creator III
Creator III

What do you mean by tables are not related?

You probably need to join the tables by creating a common key probably something like

XYZ:

load

....

Scheduled_Month,

Scheduled_Month as Month_Key,

....;

ABC:

load

....

Month

Month as Month_Key,

....;

Then you simply create straight table with Month as a Dimension and count(Scheduled_Month) as Expression

Not applicable
Author

Thanks Michael and Ivan for your replies.

Ivan I tried your suggestion. But I am making a bar chart and it is resulting in a cumulative row count of all the months in a single bar. But I want it to be in different bars for each months in ABC.Month column.
XYZ.Scheduled_Month may or may not contain all the months. So for all those months which have no rows in XYZ, the bar length should be zero.

Michael you are right. It worked only for the selected month. But I need a sort of a default display for all the months and it depends on no selections.

Anonymous
Not applicable
Author

I see what you mean.  And I see that I attached wrong file, sorry.

Take a  look at the attached now.  You don't need set here, the expression is using if() function

Not applicable
Author

Thanks Michael! This was helpful. I had to also use trim to get the match. Thanks again!