Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating Rolling Week from last week of year to 1st week of year

hi all ,

please find attachment

am trying to calculate Rolling week in that i need to show Stock of last day of every week and i have to show it for every week

i have done this but am am getting only value for last week an don selection all other weeks

i put formula like this

=Sum({<Week_p={'>=$(vMinWeek) <=$(vMaxWeek)'},p_Date={'$(vmaxDay)'}>}SOH)

Thanks in Advance

3 Replies
Anonymous
Not applicable
Author

Hello,


If you need to only sum the total for the last day of every week, you can use the weekday() function in the load script, which will return an integer 0-6 for each day of the week.

     Load

          *,

          Week(p_Date)                AS Week_p

          WeekDay(p_Date)          AS WeekDay_p

     Resident Table;

Then as your expression: =Sum({<Week_p={">=$(vMinWeek) <=$(vMaxWeek)"},WeekDay_p={'4'}>}SOH)

The expression above is returning the sum of SOH for only dates where weekday = 4 (Friday in this case), for you given Week range.

Note, in the first part of your set analysis you will need to use double quotes.


Regards,

Sean

er_mohit
Master II
Master II

preminqlik
Specialist II
Specialist II

hi there , good question, tried some thing new for u ...find attachment