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

Problem with excluding sites in a YTD Comparison, Example Attached

Hi All

Please see in the Attached Demo File, what i am trying to do. I only want a comparison of the possible Stores, not the new Stores that are only active in 201007, i hope this is enough information. If not please let me know.

Thanks.

2 Replies
Not applicable
Author

Does anyone know what i'm talking about? 🙂

johnw
Champion III
Champion III

Add this:

StoreName*=P({1<YearMonth = {$(vPYMaxDate)}>} StoreName)

Which gives you this:

=num(sum({1<YearMonth= {$(vMaxDate)}, AdvertiserNew = {'Aspen-Pharmacare'},TerminalsFlag = {'1'},ManufacturerGroup = {'Aspen-Pharmacare'},StoreName*=P({1<YearMonth = {$(vPYMaxDate)}>} StoreName) >} Sales ),'R#' )

The extra condition says to intersect the StoreNames that would have been "selected" with the StoreNames that were posssible (had sales) the same month last year. So you'll only include StoreNames that have sales in this month both this year and last year. I believe that's what you're asking for. However, I'm worried that it's a mistake. What do you want to do if a store had sales last year this month, but NOT this year this month? Currently, you'd see sales going down, even if other stores have replaced the one you lost. Not sure if that's really what you're after, but maybe it is.