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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested if statements and Set Analysis

Hi Everyone,

I am nesting some if statements and would like some assistance with the following expression. The if WeekDay 'Tue' is working, but if I add the first line to the expression it stops working. Can someone tell me why. I am attaching the file and if you open the expression for Last Week you will see this expression.

if (WeekDay([vToday])='Mon',(Sum({$<DaysFilled.Date = {'$(=vToday)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vSevenDayAgo)'} >}DaysFilled.Days)))

    or if (WeekDay([vToday])='Tue',(Sum({$<DaysFilled.Date = {'$(=vOneDayAgo)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vEightDayAgo)'} >}DaysFilled.Days)))

1 Solution

Accepted Solutions
MayilVahanan

HI

Try like this

if (WeekDay([vToday])='Mon',(Sum({$<DaysFilled.Date = {'$(=vToday)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vSevenDayAgo)'} >}DaysFilled.Days)),

     if (WeekDay([vToday])='Tue',(Sum({$<DaysFilled.Date = {'$(=vOneDayAgo)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vEightDayAgo)'} >}DaysFilled.Days))))

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

HI

Try like this

if (WeekDay([vToday])='Mon',(Sum({$<DaysFilled.Date = {'$(=vToday)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vSevenDayAgo)'} >}DaysFilled.Days)),

     if (WeekDay([vToday])='Tue',(Sum({$<DaysFilled.Date = {'$(=vOneDayAgo)'} >} DaysFilled.Days)-Sum({$<DaysFilled.Date = {'$(=vEightDayAgo)'} >}DaysFilled.Days))))

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thank you!