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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with expression

Hi guys,

I have an expression

=count({$<[Invoice Date] = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddMonths( MonthEnd (Today()),-12))'},invoice_value={"=invoice_value>0"}>}Distinct left(invoice_CustNo,5))

However this is doing a count up until the end of the month 2014.  Can this be changed somehow to only show up until the same day of the current month but previous year? e.g. 09/06/2014

Hope this makes sense

1 Solution

Accepted Solutions
qlikmsg4u
Specialist
Specialist

Hi Jamel,

make it

=count({$<[Invoice Date] = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddMonths( Today(),-12))'},invoice_value={"=invoice_value>0"}>}Distinct left(invoice_CustNo,5))


remove Monthend function

View solution in original post

5 Replies
qlikmsg4u
Specialist
Specialist

Hi Jamel,

make it

=count({$<[Invoice Date] = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddMonths( Today(),-12))'},invoice_value={"=invoice_value>0"}>}Distinct left(invoice_CustNo,5))


remove Monthend function

rubenmarin1

Or you can use Addyears() fundtion:

=count({$<[Invoice Date] = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddYears(Today(),-1))'},invoice_value={"=invoice_value>0"}>}Distinct left(invoice_CustNo,5))

PrashantSangle

Hi,

Just remove MonthEnd()

Try below

=count({$<[Invoice Date] = {'>=$(=AddMonths( YearStart (Today()),-12))<=$(=AddMonths( Today(),-12))'},invoice_value={"=invoice_value>0"}>}Distinct left(invoice_CustNo,5))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
ankit777
Specialist
Specialist

Try this

=count({$<[Invoice Date] = {'>=$(=AddMonths( Today(),-12))'},invoice_value={">0"}>}Distinct left(invoice_CustNo,5))

Anonymous
Not applicable
Author

Ah didn't realise there was a "MonthEnd" text slipped in there!

Thanks for your help everyone