Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

RunningCount

Hi All,

Greeting for the day!.

I am new to qlik and trying to build a basic running count table, I had already implemented this into SQL and now wanted to build this in qlik.

Basically, I have 3 major fields, SystemID, AgenName, Date. based on Date I want to run running count.

For more details, attaching the same set of data with required output.

23 Replies
vinieme12
Champion III
Champion III

See Attached

Expression for Running Count

=SUM( AGGR(RangeSum(Above(Count(SystemID),0,RowNo())),SystemID,Key))

Expression for Total

MAX(ALL <SystemID> AGGR(RangeSum(Above(Count(SystemID),0,RowNo())),SystemID,Key))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
rubenmarin

Hi vikas, please check attachment, I think now I understood it right.

I repeat the count when there is the same system and agent than above, if you don't want it this way just remove the conditional in the expression.

Not applicable
Author

Hi Vineeth,

unfortunately , this is not working while using date filters. please  refer enclosed qvw

vinieme12
Champion III
Champion III

it won't because I've not added that to the set expression!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hey Ruben,

Thank you for your efforts, first filed (count) is working perfectly fine but Total field is not working as required.

Basically, for total i need count based on column SystemID (e.g count of A)

rubenmarin

If you want all the rows to count the total just remove the AgentName part of the 4expression so it will be:

Count(DISTINCT TOTAL {<Date={">=$(=Date(vFdate))<=$(=Date(vEdate))"}>} SystemID)

If you want an autonumber for each system ID you can use:

If(Above(TOTAL SystemID)=SystemID,

Above(TOTAL [TOTAL]),

RangeSum(Above(TOTAL [TOTAL]),1))

The 2nd 'TOTAL' is the name of the column

vinieme12
Champion III
Champion III

See Attached updated version

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hi Ruben

Sorry, still the result is not correct, result should be link below (last column)

      

SystemIDAgentNameDateCountTOTALresult required for Total Should be count of SYstemID
12
AA110/5/2016124
AA210/6/2016224
AA310/7/2016324
AA410/4/2016424
BB110/8/2016126
BB110/12/2016126
BB210/9/2016226
BB210/13/2016226
BB310/10/2016326
BB410/11/2016426
rubenmarin

Hi Vikas, that expression can be:

Count(Distinct TOTAL <SystemID> AgentName)

Not applicable
Author

Thank you so much Vineeth, .

One more request, please guide me and explain me, if you have 2minutes