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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Sebastian_Dec
Creator II
Creator II

Counting space-separated variable

Hi, I have a problem.

I have input that contains variable iCodes:

Sebastian_Dec_2-1723103284595.png

in input:

Sebastian_Dec_0-1723103035330.png

5906764646995 5907637313075 5902627094491

Sebastian_Dec_3-1723103318027.png

 

This is a list of EAN ( European Article Number ) codes separated only by spaces

I want to count this EAN's on KPI:

count({< kod_ean = {$(iCodes)}>} kod_ean)

But I have error:

Sebastian_Dec_1-1723103256193.png

 

I try to solve this somehow but non of my code work.

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (2)
2 Solutions

Accepted Solutions
Or
MVP
MVP

You seem to be missing the string quotes, since the value isn't numeric (it contains whitespaces).

If that's meant to be multiple separate values, you'd want to comma-separate them.

View solution in original post

Sebastian_Dec
Creator II
Creator II
Author

Ok, @Or , thanks for suggestions its works!

I make new variable: iCodesFormatted that have definition:

 

=chr(34) & replace(iCodes, ' ', chr(34) & ',' & chr(34)) & chr(34)

 

The value is: "5906764646995","5907637313075","5902627094491"

And KPI count  number of codes that are searched

 

count({< kod_ean = {$(iCodesFormatted)}>} distinct kod_ean)

 

Sebastian_Dec_0-1723110268216.png

 

 

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
Or
MVP
MVP

You seem to be missing the string quotes, since the value isn't numeric (it contains whitespaces).

If that's meant to be multiple separate values, you'd want to comma-separate them.

Sebastian_Dec
Creator II
Creator II
Author

Ok, @Or , thanks for suggestions its works!

I make new variable: iCodesFormatted that have definition:

 

=chr(34) & replace(iCodes, ' ', chr(34) & ',' & chr(34)) & chr(34)

 

The value is: "5906764646995","5907637313075","5902627094491"

And KPI count  number of codes that are searched

 

count({< kod_ean = {$(iCodesFormatted)}>} distinct kod_ean)

 

Sebastian_Dec_0-1723110268216.png

 

 

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.