Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
Are you sure that you have a numeric period and there are values >= 1? Then generally these syntax worked.
- Marcus
Yes, 12 periods, all have numbers. And, the expression works if I make it equals to any period.
Please post a small example - this worked for me:
= sum({<Monat={">=11"}>} Values)
- Marcus
In this link you can find a set analysis wizard it will help you to generate the expression in the way that you want:
Hi,
Please use below expression:
=sum({1<period={"<13"}>}sales)
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
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
Thanks for all the replies!
Loic gave the best explanation.