Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Count help?

Dear All,

I'm having below case:

One line cab belong to different stations , in above case it is 3.

So what I'm looking for is count of "Global Station Label" but need to include line count too.

As of now I'm using below expression:

=count(DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>}Global Station Label)

How should I include here count of line???

I'm not looking for simply * above expression with count(Line) , I need somehow "And" condition to consider both factors.

Please suggest!

Regards,
AS

1 Solution

Accepted Solutions
sunny_talwar

May be this

=Count(DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>} [Global Station Label]&Line)

View solution in original post

19 Replies
Chanty4u
MVP
MVP

you can create a flag and add it in set expression?  did you tried this?

vishsaggi
Champion III
Champion III

‌mMay be try like

Count(Distinct Total <Line> GlobalStationLabel)

sunny_talwar

May be this

=Count(DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>} [Global Station Label]&Line)

amit_saini
Master III
Master III
Author

Hi Sunny,

When I'm Dimension as Plant and Expression =

count(DISTINCT {<Month=,Week=,Day=,Type_Name=,Why_Name=,Standard_Name=,Technology-={'No Fuel BM','No SCR inj'}>}Station_Label & Line_Name)*24

This is giving me Output as "288" for week number 6. See below:

But when I'm using same expression for keeping Week as Dimm , it's showing me different output -216

Not sure why , I should get same 0/p on Weekly chart.

Any idea?

Regards,

AS

sunny_talwar

Not sure, but could be something related to DISTINCT. Remove DISTINCT and see if you still see different numbers.

amit_saini
Master III
Master III
Author

sorry without distinct it's showing very big numbers.

Thanks,

AS

sunny_talwar

Don't have to be sorry for anything .

I know it shows big number, but my point was to check if the numbers are the same when you don't use DISTINCT. If this is true, you will need to use Sum(Aggr()) function to fix this

amit_saini
Master III
Master III
Author

No even without distinct numbers are not same of charts.

Regards,

AS

sunny_talwar

Would you be able to share a sample to check this out?