Qlik view table field expression having a variable isn't working

453 Views Asked by At

I have scorecard dashboard on qlikview. In my table I have three fields, namely Current score, Previous score and Variance(difference of the previous two columns). I am calculation current and previous score using a similar formula, only difference is the variable that is comparing the dates. My current score is calculated based on set analysis expression having date equal to current date while previous score has date equal to 1 month period back. And it works on month end date. Variable used for current & previous score:

vCurrentDate=num(Date(Current_date, 'D/M/YYYY') ) 
vCurrentPrevDate=num(Date(Montstart(Current_date)-1 , 'D/M/YYYY') )

The calculation is correct it gives numeric values for 31july 2020 and August 2020. But for my set analysis expression for previous score where I use this variable it doesn't give the value, but if I hard code the date field with date field value it gives the required score.

2

There are 2 best solutions below

0
On

num is a formatting function, meaning that will show a rounded value while keeping the full decimal value underneath. Could you try using floor instead of num?

0
On

The variable gives the value some what like 44043 while when i hard code 44043.999999988 which is the value option of date field, it gives the score I feel like somewhere in variable expression my decimal points are curbing and causing the problem