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: 
paulyeo11
Master
Master

SET Analysis How to set date greater then 2016 ?

Hi

Below expression work fine for year= 2016 :-

Sum({<year={2016},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {2016}>} sales)) <= 8"}>} sales)

I need to change the above expression for year 2016 2017 2018 . which is > 2016.

I try below , but cannot work :-

Sum({<year={">2016"},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {">2016"}>} sales)) <= 8"}>} sales)

Sum({<year>={2016},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year >= {2016}>} sales)) <= 8"}>} sales)

Hope some one can share with me.

Paul Yeo

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try correcting two quotes and a comma like:

Sum({<year={">2016"},Quarter,Month,Date,REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {[>2016]},Quarter,Month,Date>} sales)) <= 8"}>} sales)

I could not validate since your sample app doesn't have data beyond 2016.

View solution in original post

8 Replies
tresesco
MVP
MVP

Ideally your first expression :

Sum({<year={">2016"},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {">2016"}>} sales)) <= 8"}>} sales)

should work. However, if you have some other fields that has selections too can cause this not work. Then you could try by passing those fields selections like:

Sum({<year={">2016"},Quarter,Month,Date,REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {">2016"},Quarter,Month,Date>} sales)) <= 8"}>} sales)



Update: corrected a comma

paulyeo11
Master
Master
Author

Hi Tres

Thank you for your help. I have try but still not working.

Paul Yeo

MK_QSL
MVP
MVP

I can see that in enclosed file you have only 2016 data for year field.

tresesco
MVP
MVP

Try correcting two quotes and a comma like:

Sum({<year={">2016"},Quarter,Month,Date,REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {[>2016]},Quarter,Month,Date>} sales)) <= 8"}>} sales)

I could not validate since your sample app doesn't have data beyond 2016.

paulyeo11
Master
Master
Author

Thank you very much , it work now.

jasonmomoa
Creator
Creator

Hi paulyeo11‌,

your first attemp should work:

Sum({<year={">2016"},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {">2016"}>} sales)) <= 8"}>} sales)


Make sure you have [Year] values greater than 2016.


Regards,

paulyeo11
Master
Master
Author

Hi Xavier

May I know how you know due to year or Year issue ? How you find out ?

Paul Yeo

DIrector

TDS Technology (S) P/L

Whatsapp +65 9326 1804

www.tdstech.com<http://www.tdstech.com>

jasonmomoa
Creator
Creator

Hi paulyeo11‌,

I downloaded your Ask.qvf file. In there, you only have 1 value for year (=2016). Therefore, ever since you write the expression

Sum({<year={">2016"},REGION_={Singapore}, COMPANY = {"=Rank(Sum({<year = {">2016"}>} sales)) <= 8"}>} sales),

there is no year> 2016, neither Companies ranked the 8th.

If you can load more data for future years, then the expression would work.

Hope this helps.

Regards,