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: 
Anonymous
Not applicable

Expression help.

Hi

I am having a problem with the following expression:

(aggr(if(sum({<Week=,Period={$(=max(Period))}>} [Sales Forecast])=0, sum({<Week=,Period={$(=max(Period))}>}[Sales]),sum({<Week=,Period={$(=max(Period))}>}[Sales Forecast])),Week))

I want to show the sales (or forecasted sales) for a fiscal period. If I select a period then all is well. If I clear all my selections then that is OK too as it shows the sales for Period 12 (the max Period). However if I select one week then I want it to show the whole period sales for the period in which the week falls (ie if I select week 3 it will show Period 1 sales for weeks 1-4), but only the week I have selected shows. I thought that the <Week=> in the set analysis would have achieved this.  Please help

Thanks

Labels (1)
4 Replies
MK_QSL
MVP
MVP

=SUM({<InvoiceWeek = P({1<InvoiceYear>})>}$(vSaleinEURO))

Replace Week = ,

Week = P({1<Period>})

Anonymous
Not applicable
Author

Sorry Manish, still getting the same result

nilesh_gangurde
Partner - Specialist
Partner - Specialist

Try this

(aggr(if(aggr(sum({<Week=,Period={$(=max(Period))}>} [Sales Forecast]),Week)=0, aggr(sum({<Week=,Period={$(=max(Period))}>}[Sales]),Week),Aggr(sum({<Week=,Period={$(=max(Period))}>}[Sales Forecast]),Week)),Week))


-Nilesh

Anonymous
Not applicable
Author

This isn't working either