Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to sum sales of current month?

Hello everyone,

I'm new to QlikView, I never used a software like this.

I have a small table in sql where are stored all the invoices, like this:

INVOICE 1 | APR | 2013 | 100 | SALES PERSON 1

INVOICE 2 | APR  | 2013 | 200 | SALES PERSON 2


INVOICE 3 | MAY | 2013 | 300 | SALES PERSON 1


INVOICE 4 | MAY | 2013 | 400 | SALES PERSON 3

I want to sum all the invoces from the current month, to show a label like:  "Your sales of May are $700.00"

I already tried some functions and scripts found in the community but i cant get it work.

The problem is, I think, when i select other month on the table box, it sum the total for the selected month but not the current, it changes when i select other month.

Anyone can help me?

Thank you in advance.

2 Replies
Gysbert_Wassenaar

Try as expression sum({<Year={$(=year(today()))},Month={'$(=upper(Month(today())))'}>}Sales). See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you Gysbert,

I modified your expresion to my real data, and it works!!

='Ventas Totales de: '&$(MesActual)& ' '&num(sum({<FacturaAnioFecha={$(=year(today()))},FacturaMesFecha={'$(=upper(Month(today())))'}>}FacturaTotal1))&' '&'Aun faltan por facturar'&' '&num(sum(FacturaTotal1) - 3000000,'#,##0.00')

If I modify after &'Aun faltan por facturar'&' '&num(sum(FacturaTotal1) - 3000000,'#,##0.00') to your expresion again, it shows nothing.

The idea is at the same time deduct the ammount.

I try this:

='Ventas Totales de: '&$(MesActual)& ' '&num(sum({<FacturaAnioFecha={$(=year(today()))},FacturaMesFecha={'$(=upper(Month(today())))'}>}FacturaTotal1))&' '&'Aun faltan por facturar'&' '&sum({<FacturaAnioFecha={$(=year(today()))},FacturaMesFecha={'$(=upper(Month(today())))'}>}FacturaTotal1) - 3000000,'#,##0.00')

Maybe I cant see where ir wrong.

Thank you for your time!