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

change format of date functions on selection

Hi all,

I would like to know if it's possible to change the value resulting from a date function/expression for example when I select a language.

example (with DateFormat DD/MM/YYYY):

WeekDay('13/09/2012') = wed

if I make a determined selection (like "Italian") i need to change it in WeekDay('13/09/2012') = mer

I've already tried to change the system variable DayNames but doesn't work.

Thanks in advance

Francesco

7 Replies
tresesco
MVP
MVP

Actually it should work if you change the system variable correctly. Can you please upload a sample application?

Regards,

tresesco

Not applicable
Author

I tried something like the attached file (with an action on field selection).

Could it be the right way?

Thanks

francesco

tresesco
MVP
MVP

Do you have a date field and want the week days based on that or you wnat that to work on system dates like you tried with today() function? please expain your real scenario a bit more.

Not applicable
Author

Try something like this to generate a weekday field

[Date]:
load
today()-recno()+1 as Date
autogenerate(today()-'2009-01-01');

[DateParts]:
load
Date as invoice_date,
Date as Date,
Year(Date) as Year,
yearname (Date, 0, 4 )   as FinancialYear,
Weekday(Date) as WeekDay,
MonthName(Date) as monthYear
resident Date;

Not applicable
Author

the real scenario is so articulated that is very hard to explain, for this reason I'm trying with hypothesis and I'm sorry for the bad examples/explanations.

My real problem is to translate the text when the user select a language. With titles and expressions labels there are no problem, but with all the qlik functions which return a text, I don't know how to change it.

The function WeekDay (with a date field or with a fuction like "today") returns a text value ('mon;tue;wed...'); the direct question is: from where qlik gets these text values? Can I change/translate them without reload the script (with an action, trigger or expression)?

thanks for patience

Gysbert_Wassenaar

Afaik qlikview uses the system locale unless you override that in your load script with lines like SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun' etc


talk is cheap, supply exceeds demand
tresesco
MVP
MVP

you can change the interface language by setting your preference in user preference, but may be that is not what you want. However, your requirement is a bit non-standard i must say; you want the translation for all srting returning functions. i guess this is going to be not possible alone with qlikview. Had this been asked for limited functions like you mentioned for Weekday(), you could always achieve that with a mapping as the output possibility is pre defined (here only 7 day names). Would be glad, if some expert proves it wrong.