Question

Count Specific value in editable list view

  • 28 July 2020
  • 5 replies
  • 160 views

 

Hi,

 

I have an editable list that contains a column with a drop down control of two values ( Qualified and Disqualified).

I need to count the Qualified rows and the Disqualified rows sperately. I will use these two values to determine the workflow path of my process after submission.

 

any ideas how to create these counters with such logic?

 

Thanks

 


5 replies

Userlevel 1
Badge +5

Hi,


 


You might need to create a custom list count expression to get what you are looking for.
Here is a link with more information on expressions: 
https://help.k2.com/onlinehelp/k2five/userguide/5.0/default.htm#create/views/controlexpressions.htm
I hope this helps.


 


K2 will not accept any liability for any issues arising from actions taken in respect of information provided by any forum member.

Badge +1

The link above is the general user guide for expressions. Do you have any sample of implementation?

I am looking for “ListCount(If columnval=’Y’)” etc.

 

I found out a way to add an expression as a column and then sum/count. I have lots of columns in the list view and i am looking for a solution to use a single expression.

 

 

Badge +8

Maybe this will help you?

https://community.k2.com/archived-articles-108/count-drop-down-control-values-on-editable-list-view-83200

 

Userlevel 2
Badge +4

Hi @Malak @mansree2001 

 

I found another way to implement the logic of issue.

 

  1. Firstly you will need to add a count expression to the list view (refer to the attachment below).
    Adding count to the list view
  2. Then create 2 parameters one for Qualified and the other for Disqualified with default value 0. 
  3. Edit the Rule “When the View executed Initialize”, then in action “execute the  get list method” click configure and in the Filter tab add a new filter: Status =Qualified. then click finish.
  4. Add a rule Transfer data, Then transfer the count to the Qualified parameter. then finish.

     

  5. Then add action “execute the  get list method” click configure and in the Filter tab add a new filter: Status =Disqualified. then In the Output mapping map your smartObject properties. Refer to the attachment below, then click finish.
  6. Add a rule Transfer data, Then transfer the count to the disqualified parameter, then click finish.

     

  7. Then add action “execute the  get list method” click configure and In the Output mapping map your smartObject properties just like in step 5.
  8. At the end your rule will be like this:

Finally result will be the following:

Final results

Note: I made use of text box to see my values. If you want to do the same just transfer the values to the text box during step 4 & 6.

 

Regards

HulisaniN

Userlevel 1
Badge +4

if you use this value on workflow level for decision rule. 

I think you can create a stored procedure with parameter and output the aggregate value based on these categories, and then create advanced smartobjects ( point to stored procedure).

on decision rule, you can call this smartobject to get the value.

 

Reply