Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

patrou38
Contributor

Sum quantity

Hello,

I have a table in which there are a quantity of equipment by week (February weeks in my example).

in another table I would like to have the sum of qty by month.  I don't find the expression, the aggr ????

I expect that I'm enough clear.

than you for your help.

Patrick

1 Solution

Accepted Solutions

Re: Sum quantity

Oh... I see that you are doing a Distinct count... I am not sure why you need a DISTINCT... but if you need that... may be try this

Sum({<Facility = {'$(vFacility)'}, ModelFamily = {'$(vModelFamily)'}>} Aggr(Sum(DISTINCT {<Facility = {'$(vFacility)'}, ModelFamily = {'$(vModelFamily)'}>} [TC inventory]), Year_Week, Year_month))

View solution in original post

12 Replies
dapostolopoylos
Contributor III

Re: Sum quantity

If there is a Month filed in the Data Model all you have to do is to bring it in your chart instead of Year-Week field...

If you don't have a Month field i suggest you to create it...

Father/Husband/BI Developer
patrou38
Contributor

Re: Sum quantity

Hello, I tried without success as you can see below 

QTY.JPG

dapostolopoylos
Contributor III

Re: Sum quantity

You must have done something wrong with your date fields...

Can you share your script or at least the part where you create your date fields?

Father/Husband/BI Developer
patrou38
Contributor

Re: Sum quantity

ciao Dimitrios,

below my script.

thank you very much for your help.

I had in mind that the problem coming from my script

QTY2.JPG

dapostolopoylos
Contributor III

Re: Sum quantity

What i want you to show me is how you create the Calendar fields and most of all the Work_Week field which is your key

Father/Husband/BI Developer
patrou38
Contributor

Re: Sum quantity

ok.

the calendar is defined in an excel file like this:

QTY3.JPG

dapostolopoylos
Contributor III

Re: Sum quantity

Your calendar seems to be allright...

Did you use the Sum() function when yoyu tried to replace Year_Week with Year_Month in your chart?

Father/Husband/BI Developer
patrou38
Contributor

Re: Sum quantity

I'm using the same expression for the both .. .either for week or for month ....

QTY_week.JPG

Re: Sum quantity

Would you be able to share your Excel file by attaching it here

Uploading a Sample