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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
canmarroig
Partner - Creator
Partner - Creator

Variable for weekly report

Hi, i need a help, I've a variable to calculate a vDate, in order to produce a weekly report and i need this is calculated only if the first day of month is Monday, if not i need to take Monday on the previous week in order not to loose days over two different months. How can i do? Tks in advance

Labels (1)
4 Replies
Anonymous
Not applicable

You can use in script:

Replace today() with your date. vDate will hold the monday, if ihe first day of month ios monday, otherwisethe monday of the previous week of your specified date.

LET vDate=

If (num(weekday(monthstart(today())=0),

     makeweekdate(year(today(), week(today()),

     makeweekdate(year(today(), week(today()-1))

Is that what you want?

arjunkrishnan
Partner - Creator II
Partner - Creator II

=Date(If(MonthsStart(WeekDay(Today()),0),   makeweekdate(year(today()), week(today())),

makeweekdate(year(today()), week(today()-1))),'DD/MMM/YYYY'

)

Anonymous
Not applicable

Sorry, wrong bracket

 

= Date(If(weekday(MonthStart(Today()))=0,
     makeweekdate(year(today()), week(today())),
     makeweekdate(year(today()), week(today())-1)),'DD/MMM/YYYY')

Anonymous
Not applicable

Hello Arjun,

I had a wrong bracket.This is correct (I tested it)

=Date(If(weekday(MonthStart(Today()))=0,

makeweekdate(year(today()), week(today())),

makeweekdate(year(today()), week(today())-1)),'DD/MMM/YYYY')

Regards

Rudolf