Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

cannot use '>' in set analysis

Hi,

I'm having a problem using '>' in a set analysis.

The expression works fine without '>', but after adding '>', it returns 0.

=sum({1<period={">=1"}>}sales)

What could be the reason?

Thanks,

dodo

1 Solution

Accepted Solutions
lft
Employee
Employee

In some occasions, QlikView can consider that numerical values are text. This can happen for instance when the source file is excel, and that the cell type in excel is text, and not numerical.

in this case

the = statement in set analysis works, because QlikView makes a string to string comparison : "1" = "1" returns true

the >= statement does not because we don't have an inequality comparator on strings : "1" >= "1" returns false

have you tried forcing the column type in the script using for instance "Num(period) as period"

you could also force a numerical type in the document properties ("number" tab)

Loic

View solution in original post

9 Replies
marcus_sommer

Are you sure that you have a numeric period and there are values >= 1? Then generally these syntax worked.

- Marcus

Not applicable
Author

Yes, 12 periods, all have numbers.  And, the expression works if I make it equals to any period.

marcus_sommer

Please post a small example - this worked for me:

= sum({<Monat={">=11"}>} Values)

- Marcus

Not applicable
Author

In this link you can find a set analysis wizard it will help you to generate the expression in the way that you want:

Set Analysis Wizard for QlikView | qlikblog.at

Anonymous
Not applicable
Author


Hi,

Please use below expression:

=sum({1<period={"<13"}>}sales)

lft
Employee
Employee

In some occasions, QlikView can consider that numerical values are text. This can happen for instance when the source file is excel, and that the cell type in excel is text, and not numerical.

in this case

the = statement in set analysis works, because QlikView makes a string to string comparison : "1" = "1" returns true

the >= statement does not because we don't have an inequality comparator on strings : "1" >= "1" returns false

have you tried forcing the column type in the script using for instance "Num(period) as period"

you could also force a numerical type in the document properties ("number" tab)

Loic

aveeeeeee7en
Specialist III
Specialist III

Hi

See this:

restrict data in a table

Regards

Aviral Nag

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

in order to check if your field is reading values as number you can either check it in the table viewer (ctrl + T) and put the mouse over the field in the data model to see the type of data of that field. Another option is creating a listbox/tablebox with this field. By default qlikview aligns numbers to right and text to left,

regards

Not applicable
Author

Thanks for all the replies!

Loic gave the best explanation.