Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
evan_kurowski
Specialist
Specialist

Alternate state evaluating expression different than default

Hello All,

I'm trying to get a system working where the selections for an end-users ID are moved out to an alternate state, so that selections can be applied in the alternate state without reducing the default data set, and I have created a state called Selections.

Except when I move a copy of my user Ids to an island table and then assign that table to the separate state, the syntax that checked for evaluating matches stops working.  I've marked the expressions that seem ok in green and the ones that are functioning differently in the alternate state in red.  Any thoughts?

8 Replies
Anonymous
Not applicable

1.png

not sure what exactly the issue is but in the second text box where you check for the UISelector in Selections state, i removed the single quotes for the value in the if condition and it checks fine.

Not applicable

I created a new state State1 and it seems to work as expected.

Edit: As suggested by Jsaradhi, removing quotes around the number works

evan_kurowski
Specialist
Specialist
Author

Hello jsaradhi, Ajay,

I'm confused then, why does the expression against UsrID using single quotes evaluate properly in all states?

=IF(UsrID='0.015625','TRUE','FALSE')

What would be the indicator for when and where you can or cannot use quotes?

Not applicable

My theory:

Usually number fields dont need quotes, its required only for text values. But people use even for numbers, forcing QV to read it as a text. Maybe something to do with that.

Anonymous
Not applicable

I agree with Ajay about the use of single quotes for numbers. I am guilty of it too sometimes.

evan_kurowski
Specialist
Specialist
Author

Well, I appreciate you taking the time to look.

But here's something weird.. I thought maybe having ID values using a decimal it might be something making the evaluation inconsistent, so I tried to push them to integers.

Except when I multiply the same value from the ID fields, I get two different evaluations of the Floor() function.  Why aren't these matching?

20140815_Floor_divergence.png

Not applicable

I have come across this and the solution I found was using this:

=Floor(Num#(UISelector) * 100000000)

I used to compare numbers like If (Value=Cost,1,0) and for  1.2342 = 1.2342 it would return false. I searched the forum and found the solution as to use Num#().  I will paste the link if i come across it again.

Not applicable

This might help:

http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors

Also when I tried converting the two numbers to binary they were giving me two different results:

=Num(UsrID,'(bin)') or =Num(UsrID,'(hex)')

The above link might throw some light on that.