Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

amit_saini
Honored Contributor 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

Re: Count help?

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)

19 Replies
sureshqv
Esteemed Contributor III

Re: Count help?

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

vishsaggi
Esteemed Contributor III

Re: Count help?

‌mMay be try like

Count(Distinct Total <Line> GlobalStationLabel)

Re: Count help?

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
Honored Contributor III

Re: Count help?

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

Re: Count help?

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

amit_saini
Honored Contributor III

Re: Count help?

sorry without distinct it's showing very big numbers.

Thanks,

AS

Re: Count help?

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
Honored Contributor III

Re: Count help?

No even without distinct numbers are not same of charts.

Regards,

AS

Re: Count help?

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

Community Browser