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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pgarcia75
Contributor III
Contributor III

Load Date and MontName Function

Hello

I charge date from a MySQL database that I want to convert function with montname function

The latter gives me names in English while the xx variable exists in French.

In addition, after help in line, I should have the month and year

Who can help me ?

Thank you

ThousandSep=' ';
SET DecimalSep=',';
SET MoneyThousandSep=' ';
SET MoneyDecimalSep=',';
SET MoneyFormat='# ##0,00 €;-# ##0,00 €';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD/MM/YYYY';
SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';
SET MonthNames='janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.';
SET LongMonthNames='Janvier;Fevrier;Mars;Avril;Mai;Juin;Juillet;Aout;Septembre;Octobre;Novembre;Decembre';
SET DayNames='lun.;mar.;mer.;jeu.;ven.;sam.;dim.';

ODBC CONNECT TO Mediweb (XUserId is BLIVRbVMCTWA, XPassword is aSSdVbVMCDQB);

SQL SELECT
    no,
   `periode`,
  `urm`,
  `service`,
   MonthName(`periode`) as mois,
   year(`periode`) as annee
FROM mediweb.stat;

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Since the Year and MonthName functions are in the SELECT statement, they are evaluated by the ODBC driver, and not by the QIX engine. Try instead

Load

    no,

   `periode`,

  `urm`,

  `service`,

   MonthName(`periode`) as mois,

   year(`periode`) as annee;

SQL SELECT * FROM mediweb.stat;

where the functions are in the Load - which is evaluated by the QIX engine.

HIC

View solution in original post

7 Replies
MK_QSL
MVP
MVP

You need to change system variables

SET MonthNames='janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.';
SET LongMonthNames='Janvier;Fevrier;Mars;Avril;Mai;Juin;Juillet;Aout;Septembre;Octobre;Novembre;Decembre';
SET DayNames='lun.;mar.;mer.;jeu.;ven.;sam.;dim.';


Change them to english..!!

pgarcia75
Contributor III
Contributor III
Author

The result is in english but I would have in french !

How I can do ?

hic
Former Employee
Former Employee

Since the Year and MonthName functions are in the SELECT statement, they are evaluated by the ODBC driver, and not by the QIX engine. Try instead

Load

    no,

   `periode`,

  `urm`,

  `service`,

   MonthName(`periode`) as mois,

   year(`periode`) as annee;

SQL SELECT * FROM mediweb.stat;

where the functions are in the Load - which is evaluated by the QIX engine.

HIC

sasiparupudi1
Master III
Master III

not clear, can you please give an example?

Anonymous
Not applicable

I agree with henric

We can't use the Qlikview logis such as Month Name and "as" in the SQL statement.

So we need to do the preceeding load statements before your SQL select table.Use Henric's codes

pgarcia75
Contributor III
Contributor III
Author

Great it's working !!

Thanks for all

satishkurra
Specialist II
Specialist II

Thanks Henric for your valuable answer:)