Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vinisefrin
Contributor II
Contributor II

MID() to Month with error

Good afternoon, I need to solve the following question:

I got a script here, and the people doing the following ...

MID (Data_Referencia, 4.2) as Month_Select

where the reference date in this format 01/08/2013.

thus returning this:

01

01

01

01

01

01

01

01

01

01

01

01

But if I send in the property list display as number with four decimal places of precision, shows me correct:

1

2

3

4

5

6

7

8

9

10

11

12

therefore, can not make a key with a Load * inline to bring the "name" of the month, which could be easily solving through a month ().

But do not want to mess around scritp, they may compromise the rest of the application ...

These two ways he does not let you make your selection in the "names" because of the records they see everything as 01.

Know cuz it occur?

Hugs and Thanks

2 Replies
Clever_Anjos
Employee
Employee

If you want the month number, you should use Month() function, no Mid.

Month() will handle formating dates issues

vinisefrin
Contributor II
Contributor II
Author

Clever Good afternoon,

Yes, I am aware that the correct use would be the month (), but the script is not mine, I can not change, just wanted to understand why he was returning the records in this way, 01 and not the correct month, and formatting with 4 decimal places of accuracy in the properties of the list it shows correct.

hugs