Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
vsap2000
Creator
Creator

Calculate count number with dot

Hello Guys.

I have a field name Class_id which has value 

1

1.1

1.2.1

2

2.1

2.2

3

4

IF i do count of Class_id I will get 8, now requirement is to calculate count which has dot or period, if I count those will get answer as 4, so how can I get using set analysis or any other approach.

 

Thanks in advance.

vsap2000

 

2 Solutions

Accepted Solutions
Kushal_Chawda

try this expression

=count({<Class_ID={"=SubStringCount(Class_ID,'.')"}>}Class_ID)

View solution in original post

Kushal_Chawda

this should work

=count({<ID={"=SubStringCount(ID,'.')=0"}>}ID)

View solution in original post

6 Replies
Kushal_Chawda

how is the value of period?

vsap2000
Creator
Creator
Author

Thanks for reply and sorry for confusion, I need to count for Class_id that has dot or period as shown below

1.1

1.2.1

2.1

2.2

so answer I should get 4.

Hope that clarifies.

-vsap2000

 

Kushal_Chawda

try this expression

=count({<Class_ID={"=SubStringCount(Class_ID,'.')"}>}Class_ID)

vsap2000
Creator
Creator
Author

Thanks Kush, it worked. I have other question related to this subject, if I need to get the count of Class Id which don't have . or period how I can accomplish that? So here I need to count for Class Id 

1

2

3

4

Thanks again.

- vsap2000

Kushal_Chawda

this should work

=count({<ID={"=SubStringCount(ID,'.')=0"}>}ID)

vsap2000
Creator
Creator
Author

Thanks for your help.