Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum gross

Hi!

this is the data is have :

month_salessales managergross
JanA100
JanB200
JanC100
FebA200
FebB300
FebC400

(for every month and every sales manager, his gross)

and I would like to have an expression that shows the sum of  current month total gross.

this works when I select the current month. but if I make no selection then the value is 0..


=sum(if(date(today(),'MMM')=(month_sales), gross,0))


thank you all

3 Replies
Anil_Babu_Samineni

Expected o/p?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master
Master

Hi Namma,

Try:

=sum({$<month_sales = {$(=Month(Today()))}>}gross)

Cheers

Andrew

sunny_talwar

I would suggest creating a MonthYear field in your script

LOAD DateField,

           Date(MonthStart(DateField)) as MonthYear,

           Month(DateField) as Month

FROM/Resident ...;

and then may be something like this:

=Sum({<MonthYear = {"$(=Date(MonthStart(Today())))"}>} gross)