Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vStefano
Contributor II
Contributor II

Get year from date and use it in formulas - beginner

Good morning,

I am new to Qliksense and have been experiencing the first issues with formula.

Briefly, I am writing a formula to sum order amount in the current year. In my database there is not a field with the year, just the date.

I have tried the following formula but now value is shown:

=Sum({$<
[DateType]={'Request_Date'},
OnHold = {'No'},
Samples = {'No'},
[DRP Y/N] = {'No'},
[Date Cancelled] = {"1899-12-30"},
[Customer Type] = {'DOM','FOR'}>},
[Date Entered] = {"$(='>=' & Date(YearStart(Today()), 'YYYY-DD-MM') & '<=' & Date(Today(), 'YYYY-DD-MM'))"}>}
[Euro Total])

 

Can some help me?

 

Thanks in advance,

Stefano

 

2 Solutions

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

change it to

=Sum({$<
[DateType]={'Request_Date'},
OnHold = {'No'},
Samples = {'No'},
[DRP Y/N] = {'No'},
[Date Cancelled] = {"1899-12-30"},
[Customer Type] = {'DOM','FOR'}>},
[Date Entered] = {">=$(=Date(YearStart(Today()), 'YYYY-DD-MM'))<=$(=Date(Today(), 'YYYY-DD-MM'))"}>}
[Euro Total])

View solution in original post

vStefano
Contributor II
Contributor II
Author

Thanks, at the end both formulas worked. I had just forgotten to take out >} after customer type.

Thanks again for your quick answer.

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

change it to

=Sum({$<
[DateType]={'Request_Date'},
OnHold = {'No'},
Samples = {'No'},
[DRP Y/N] = {'No'},
[Date Cancelled] = {"1899-12-30"},
[Customer Type] = {'DOM','FOR'}>},
[Date Entered] = {">=$(=Date(YearStart(Today()), 'YYYY-DD-MM'))<=$(=Date(Today(), 'YYYY-DD-MM'))"}>}
[Euro Total])

vStefano
Contributor II
Contributor II
Author

Thanks, at the end both formulas worked. I had just forgotten to take out >} after customer type.

Thanks again for your quick answer.