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: 
dseelam
Creator II
Creator II

Shortages

Hello All,

I am working on inventory DB, would like to know my shortages in % for next 10 weeks starting today(), it doest matter with datw it should be always starting today

Worked on scenario in attached samples but it is giving me shortages from 10th week to rest of the year as it is coming from master calendar

Thanks D

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

I don't clearly understand what you are looking for

but the expression seems to be working

PFA

View solution in original post

6 Replies
aarkay29
Specialist
Specialist

you need to use something like this set analysis

=(sum({$ <WKDT = {">=$(=today())<=$(=Date(WeekEnd(Today()+9*7)))"}>} ASCP.DMND)-sum({$ <WKDT = {">=$(=today())<=$(=Date(WeekEnd(Today()+9*7)))"} >} ASCP.ON_HAND))/(sum({$ <WKDT = {">=$(=today())<=$(=Date(WeekEnd(Today()+9*7)))"}>} ASCP.DMND)*100)

dseelam
Creator II
Creator II
Author

Aar,

what if the WKDT are only start date of the week for example WKDT is only bringing every Monday from source

Thanks,

D

aarkay29
Specialist
Specialist

May be this


=(sum({$ <WKDT = {">=$(=WeekStart(today()))<$(=Date(WeekStart(Today()+10*7)))"}>} ASCP.DMND)-sum({$ <WKDT = {">=$(=weekStart(today()))<=$(=Date(WeekStart(Today()+10*7)))"} >} ASCP.ON_HAND))/(sum({$ <WKDT = {">=$(=WeekStart(today()))<=$(=Date(WeekStart(Today()+10*7)))"}>} ASCP.DMND)*100)

dseelam
Creator II
Creator II
Author

Aar,

its not working with only week start dates from source

aarkay29
Specialist
Specialist

I don't clearly understand what you are looking for

but the expression seems to be working

PFA

dseelam
Creator II
Creator II
Author

Aar,

My bad you are right some how my source data is giving blanks

Thanks,

D