Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mgdotcom
Contributor III
Contributor III

Sum for entire month

I hope someone can help. I need to calculate a sum of target for the entire month selected.

This is my load of the target table

Targets:

LOAD targetID,

     clientID,

     super_categoryID,

     ext_campaignname,

     target,

     Date(workingday,'YYYY/MM/DD')as Date

And my calendar

Calendar:

LOAD Date(Date,'YYYY/MM/DD') as Date,

8 Replies
Anil_Babu_Samineni

Not sure, I followed you. can you explain little in clear

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
mgdotcom
Contributor III
Contributor III
Author

Sorry. So target is a numerical value.

I'm currently doing this is a chart to calculate the daily target based on a selection of year, month and date.

Sum(Aggr(Sum(target),clientID,super_categoryID))

What I would like to do is do a calculation for the entire month. So it shows a monthly Target.

Anil_Babu_Samineni

Like this?

Sum(Aggr(Sum(TOTAL <Month> target),clientID,super_categoryID))

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
its_anandrjs

Do you have Month field in your Calendar table if not add this ways

Targets:

LOAD

    targetID,

     clientID,

     super_categoryID,

     ext_campaignname,

     target,

     Date(workingday,'YYYY/MM/DD')as Date

Calendar:

LOAD Date(Date,'YYYY/MM/DD') as Date,

Month(Date,'YYYY/MM/DD') as Month


And on UI part


Dim:- Month (And selected Month)

Expre:- =Sum(target)




mgdotcom
Contributor III
Contributor III
Author

Snip20171206_1.png

This is what i get when I use Sum(Aggr(Sum(TOTAL<Month> target),clientID,super_categoryID))

Anil_Babu_Samineni

Have you considering Month as fieldName?

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
mgdotcom
Contributor III
Contributor III
Author

I have a month field in  calendar. Would i need one in target also?

Anil_Babu_Samineni

Would you mine, Can you provide sample data set and result set?

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