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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Scripting : function date

Hello all,

I need your help to create a script in Qlikview. I have a excel file, it's contains date (jj/mm/yy) and values of each date.

I need to convert date to day, for example if i have 25/09/2015, it's corresponds to Friday. and when we define all days for the date, we should determine the week, for example we suppose after the conversion we have : Friday saturday sunday monday tuesday wednesday thursday friday saturday sunday we can determine that for the week1 : we have friday saturday sunday and week2 we have : monday tuesday wednesday thursday friday saturday.

I thought to choose day fuction for the conversion date to day. but i don't have any idea how i can determine the week.

Thank you for your help!

Bonjour à tous,

J'ai besin de votre aide pour développer un script sous Qlikview. en effet j'ai un fichier excel qui contient des dates dans les headers, et des valeurs pour chaque colonne date. ce que je voudrais faire c'est par exemple si je trouve 25/09/2015 je peux déterminer le jour qui correspond à cette date et donc déduire qu'il s'agit d'un vendredi. et après avoir déterminer les jours, je voudrais déduire la semaine. On suppose que je trouve après la conversion Mercredi jeudi vendredi samedi dimanche lundi mardi mercredi jeudi vendredi samedi dimanche, je peux dire que le week 1: Mercredi jeudi vendredi samedi dimanche et week2: lundi mardi mercredi jeudi vendredi samedi dimanche.

J'ai pensé à utiliser la fonction day pour déduire le jour à partir d'une date, mais je n'ai aucune idée comment je peux faire pour déterminer les semaines.

Merci pour votre aide !

16 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try with this script and the Excel file you first posted in the same directory.

Dabord:

CROSSTABLE (Date, Nombre)

LOAD 'P ' & RowNo() AS Propriété,

     *

FROM [.\Qlikview scripting.xlsx](ooxml, embedded labels, table is Feuil1);

Données:

NOCONCATENATE

LOAD Propriété, Date(num#(Date)) AS Date, Nombre

RESIDENT Dabord;

DROP Table Dabord;

Calendrier:

LOAD DISTINCT Date,

Week(Date) as Semaine,

WeekDay(Date) as Semaine_Jour,

WeekName(Date) as Semaine_Nom,

WeekYear(Date) as Semaine_Année

RESIDENT Données;

Best,

Peter

Not applicable
Author

could you send me the script on qvs format please?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you don't add values for dimension Resource, you won't be able to make selections of different rows.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Copy/Paste from my last post. It's the complete script from the QVW, except for the localized SET statements (which are created automatically in every new document)

Not applicable
Author

ok Thank you, i will try it

Not applicable
Author

Thank you Peter , it works

Thank you all for your help !

Not applicable
Author

Thank you Adam for your help, it's solved