Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

mgdotcom
New Contributor

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

Re: Sum for entire month

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

mgdotcom
New Contributor

Re: Sum for entire month

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.

Re: Sum for entire month

Like this?

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

Re: Sum for entire month

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
New Contributor

Re: Sum for entire month

Snip20171206_1.png

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

Re: Sum for entire month

Have you considering Month as fieldName?

mgdotcom
New Contributor

Re: Sum for entire month

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

Re: Sum for entire month

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

Community Browser