Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with column contents as *

I have a table where the default value of many cells is an asterisk (*).  In my set expression I'm trying to select on these values, but the resulting sum is totaling the entire selection - probably because the * is actually an operator of some description.  I've attempted to place it inside quotes, eg

'*'

and "*"

both these result in the same end result - the entire set is summed, not just the columns with cells = *.

sum(

{

  $<my_column_id={"*"}>

} us)

Any ideas how i can 'escape' * to mean "*"?

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this one: sum({$<my_column_id={"=my_column_id='*' "}>}us)


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Clever_Anjos
Employee
Employee

=count({<my_column_id={"=my_column_id=chr(42)"}>}Dim1)

Gysbert_Wassenaar

Try this one: sum({$<my_column_id={"=my_column_id='*' "}>}us)


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks fellows - Clever Anjos, your response works also if I substitute the 'count' for 'sum'.

Clever_Anjos
Employee
Employee

sorry, mistyped here, it was supposed to be a sum

Clever_Anjos
Employee
Employee

Maybe you can mark my answer as "Helpfull"

tamilarasu
Champion
Champion

You can also try below in your load script.

Replace(Fieldname, '*' , '|') as NewFieldname

Expression as

sum({<$<NewFieldname={"|"}>} us)

Not applicable
Author

Definitely something to remember for the future - I have about 57 columns in my datasource, the above formulas are good workarounds but as the expressions get larger (I have a behemoth to write shortly), they will, i suspect, start to become somewhat hard to read.

tamilarasu
Champion
Champion

While loading you can change the script as

Load Field1,

Replace(Field2,'*','|') as Field2

From source;

So you will have same number of columns (57). I just give you an idea. If you have one or two, it would be helpful.