Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I execute the abobe statement in QV12 and QV11 and i receive diferent values. Any thoughst? why C variable have different values?. The variable dateformat have the same setting in both. SET DateFormat='M/D/YYYY';
LET A = Today();
LET B = Today()+1;
LET C = IF(1=2,Today()+1,Today());
QV12
C 12/23/2019 2:08:40 PM
B 43823.589340278
A 12/23/2019 2:08:38 PM
QV11
C 43822.590185185
B 43823.590173611
A 12/23/2019 2:09:50 PM
It is indeed about how the expression has been evaluated.
Case 1: LET A = Today();
Here the Today() function returns a dual value - both a number and a string. The string corresponds to the formatted date, used for display. So the variable gets both a number a string.
Case 2: LET B = Today()+1;
The Today() function still returns a dual value, but since a number is added to the numeric value, the string representation is invalidated. So the formatted date is not carried over to the variable. In QlikView 11 all modifications of the date will invalidate the string returned by Today().
For QlikView 12 we have changed this slightly, since we realized that we do not need to be so strict.
Case 3: LET C = IF(1=2,Today()+1,Today());
In QV12, the If() function sometimes invalidates the string, sometimes not. In this case, it is invalidated for the 2nd parameter but not for the 3rd.
So, yes, QlikView 11 and QlikView 12 are slightly different here: QlikView 12 is smarter.
See also https://community.qlik.com/t5/Qlik-Design-Blog/Data-Types-in-QlikView/ba-p/1474977
HIC
Hi,
What i understand is, this difference is because of the way the expression is getting evaluated.
@hic can help us more to understand this.
Regards,
Kaushik Solanki
Following Design Blog posts may be of some help:
https://community.qlik.com/t5/Qlik-Design-Blog/Why-don-t-my-dates-work/ba-p/1465849
https://community.qlik.com/t5/Qlik-Design-Blog/Get-the-Dates-Right/ba-p/1476178
Here is the base Design Blog link in case you want to search further on your own:
https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog
The two specific posts are both by Henric, just FYI.
Regards,
Brett
Is not a format issue the problem is the way the expression is getting evaluated. Notice that the if statement go to today() function in both cases and the result is diferent
It is indeed about how the expression has been evaluated.
Case 1: LET A = Today();
Here the Today() function returns a dual value - both a number and a string. The string corresponds to the formatted date, used for display. So the variable gets both a number a string.
Case 2: LET B = Today()+1;
The Today() function still returns a dual value, but since a number is added to the numeric value, the string representation is invalidated. So the formatted date is not carried over to the variable. In QlikView 11 all modifications of the date will invalidate the string returned by Today().
For QlikView 12 we have changed this slightly, since we realized that we do not need to be so strict.
Case 3: LET C = IF(1=2,Today()+1,Today());
In QV12, the If() function sometimes invalidates the string, sometimes not. In this case, it is invalidated for the 2nd parameter but not for the 3rd.
So, yes, QlikView 11 and QlikView 12 are slightly different here: QlikView 12 is smarter.
See also https://community.qlik.com/t5/Qlik-Design-Blog/Data-Types-in-QlikView/ba-p/1474977
HIC