Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension - STRANGE BEHAVIOUR

I'm noticing a very strange behaviour while defining a calculated dimension in a line chart. Please see the following screenshots and let me know if you have any idea of this strange behaviour.

I'm writing this in calculated dimension (numDate)

Capture1.PNG.png

But the output display is seen as :

Capture2.PNG.png

Here it can be seen that less than 40721.33055 is being shown. How is this possible?

I have the one more similar sample but the output display is absolutely correct in that case.

Capture4.PNG.png

Correct output can be seen as follows:

Capture3.PNG.png

Can anyone explain this behaviour?? Unfortunately I can't share my qlikview files and data due to privacy issues.

Labels (1)
6 Replies
quwok
Creator III
Creator III

Your value is being read as a number, you'll need to set it to the date number format.

Frank_Hartmann
Master II
Master II

Try this in script

Date(Date#(numDate)) AS numDate

Not applicable
Author

Hi

Thanks for the reply. But if the values are being read as a number, still the comparison operator should work fine. In fact I intentionally converted my dates to Num(Dates) so that numbers are compared instead of dates

Not applicable
Author

Hi Frank

I would like to know what's wrong in comparing two numbers here..??

quwok
Creator III
Creator III

Ah, the year made me think you are looking after the date. Having looked at your issue a bit closer, it seems that your decimal comma is causing an issue with the comma of the if statement.

Your expression:

=if(numDate>=40721,330555556,numDate)

is read as

if numDate>=40721 then 330555556 else numDate

hence every number that is smaller than 40721 is shown.

Not applicable
Author

I thinik that's the actual reason.

I resolved it by converting number to Date.

Thanks...!!!!