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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
urivera
Partner - Contributor III
Partner - Contributor III

Select a week from a selected date in a macro

hi all,

In a macro i wrote a code that select a year, month and day, I select the values from today() function. In a model i have too a year-week, i need to select this field from another data, ie, year + month + day, all in a macro...

If i use the function week() in a macro it does not work.

any idea...?

thks.

5 Replies
Not applicable

try with datepart("ww", date)

Not applicable

What format is your week column in? We use WWYYYY a lot.

Week() will give you the WW and WeekYear() should give you the YYYY. You probably want:

Week(Today()) & WeekYear(Today())


urivera
Partner - Contributor III
Partner - Contributor III
Author

hi Dragonauta,

Do you speak spanish?, ok, can you explain datepart function pls, i cannot find this command in QV manuals...

thks.

Not applicable

I don't think DatePart is a QlikView function. I know it exists in T/SQL and VBScript though.

Not applicable

sí hablo español.

datepart es una función de vbscript, porque según entiendo lo quieres usar en una macro, no? Y ahí puedes usar vbscript y/o jscript.

aquí hay más información de la función si quieres:

http://www.w3schools.com/VBscript/func_datepart.asp