Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

paulyeo11
Not applicable

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

Re: SET Analysis How to set date greater then 2016 ?

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.

8 Replies
tresesco
Not applicable

Re: SET Analysis How to set date greater then 2016 ?

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

Re: SET Analysis How to set date greater then 2016 ?

Hi Tres

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

Paul Yeo

MK_QSL
Not applicable

Re: SET Analysis How to set date greater then 2016 ?

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

tresesco
Not applicable

Re: SET Analysis How to set date greater then 2016 ?

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

Re: SET Analysis How to set date greater then 2016 ?

Thank you very much , it work now.

jasonmomoa
Not applicable

Re: SET Analysis How to set date greater then 2016 ?

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

Re: SET Analysis How to set date greater then 2016 ?

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

Re: SET Analysis How to set date greater then 2016 ?

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,