Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

right/left function - bug in Qlikview 11?

Hi,

On a chart dimension, the following problem occurs since I upgraded to Qlikview 11 SR1. It was displayed properly on Qlikview 10.

I have a dateString field that looks like this: 2012-05-22

This is what I see in my graphin Axis when I use the following dimension:

right(dateString,5)

righ_function_bug.png

Above is an example of what happens when I apply the right function to my string... I'm confused

Is it a know bug in Qlikview 11?

1 Solution

Accepted Solutions
Not applicable
Author

I found a solution

timestamp4.png

Problem solved... but I still maintain that I didnt have to do that in Qlikview 10, grrrr.

Thanks for you help guys.

View solution in original post

8 Replies
martinpohl
Partner - Master
Partner - Master

QV defines a date as a number as default.

So your script should be

load (right(text(datestring),5) as date

swuehl
MVP
MVP

Interesting...

Your dateString is of date or timestamp data type with a numerical representation, right? (You could check this in table view). It seems that the right function is applied to the numerical representation, not the textual.

But I would agree this is not the result I would expect and it seems to break existing coding.

I am just working on QV 11 IR at the moment, in this version it's returning the correct string part.

I am going to test on QV 11 SR1 later on.

Not applicable
Author

Yes, I think that's a bug.

dateString is a varchar hence a right([varchar],5) should give me the last 5 chars of the string...

And as I mentionned, it worked fine on Qlikview 10.

I just feel bad for people who might extensively use this function on dates and are going to upgrade... BEWARE!

I'm just going to replace dateString by Month&' '&Day... But both should have worked.

swuehl
MVP
MVP

I believe your dateString will automatically be parsed in as date type by QV (given the standard date format matches). You might want to check the date type in table view by hovering over the field to verify this.

And I believe Martin's suggested workaround should work also, but using date functions like Month and Day might be a good solution anyway.

Not applicable
Author

I tried Martin's suggestion on the object itself:

timestamp2.png

It's just not working at all for a timestamp...

timestamp3.png

Note about this field, I load it using the from_unixtime function on an epoch time. Would that be the problem?

Not applicable
Author

I found a solution

timestamp4.png

Problem solved... but I still maintain that I didnt have to do that in Qlikview 10, grrrr.

Thanks for you help guys.

swuehl
MVP
MVP

I would like to see the solution, but I can't open the image. Could you please double check the link? Or post the code you used to transform the data?

Not applicable
Author

Sorry, I reuploaded the screenshot.