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

Filter question

Hi All,

I created an app and is working fine. In the app, I want to add a table chart that shows sales this year in one column and sales prior year in second column.  But here is the problem- I have a list box with all the years and if I select a particular year as filter, it gets applied to this chart as well screwing it up. Any idea how to deal with htis situation?

Thanks in advance!

11 Replies
Not applicable
Author

Hi,

For YTD and LYTD we Below Expression

Current Year : Sum({<Year={$(=Max(Year))}>} Sales)

Previous Year : Sum({<Year={$(=Max(Year)-1)},Month={">$(=Min({<Year={$(=Max(Year))}>} Month-1))<$(=Max({<Year={$(=Max(Year))}>} Month+1))"}>} Sales)

If the data is at Day level then we add another condition in the Previous Year Expression.

Hope This will work for you.

Regards,

Srini

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

In the initial request, you said that you want to create a column for "prior year sales". Did you actually need a full prior year sum, or "Prior YTD" sum?

For YTD calculations, to avoid complex Set Analysis expression, I usually create flags in the master calendar table. For each date, I set a flag to 1 if it belongs to YTD (Prior YTD, QTD, etc...). then the Set Analysis condition is very simple:

sum({<YTD_Flag={1}>}  Sales) - for current YTD

sum({<PYTD_Flag={1}>}  Sales) - for Prior YTD

cheers,

Oleg

Ask me about Qlik Sense Expert Class!