Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Using TOTAL with set analysis by Year

I need to do the following. Get a total of ALL sales for a month but for only a specific year:

Data:

Client    Month   Sales   Year

A             Jan       100   2013

A             Feb        50   2013   

B             Jan        200  2013

B              Feb      100  2013

A             Jan        75   2012

A             Feb        50   2012   

B             Jan        100  2012

B              Feb       75   2012

Object results:

Client   Month     Sales-2103   Sales-2012

A          Jan         300               175

B          Jan         300               175

A          Feb         150               125

B          Feb         150               125

Basically have to add Set analysis for 2012 and for 2013 to this expression:Sum(total<Month>Sales)... but I must have my syntax wrong because I am coming back with blanks.

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try these expressions:

sum({<Year={2013}>} total <Month> Sales)

sum({<Year={2012}>} total <Month> Sales)


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
jpapador
Partner - Specialist
Partner - Specialist

Two expressions:

1. Sum({$<Year={2013}>}Sales

2. Sum({$<Year={2012}>}Sales

Make your dimensions Client and Month

zagzebski
Creator
Creator
Author

This would not total for ALL sales regardless of the client in the dimension.

jpapador
Partner - Specialist
Partner - Specialist

Ah I'm sorry.  I think what you are looking for is:

Sum(TOTAL <Year, Month> Sales)

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try these expressions:

sum({<Year={2013}>} total <Month> Sales)

sum({<Year={2012}>} total <Month> Sales)


talk is cheap, supply exceeds demand
jpapador
Partner - Specialist
Partner - Specialist

Yep was going to add that, Going to still need two expressions if you want separate columns for years

zagzebski
Creator
Creator
Author

Close! - but I need to have one column that is just for 2012 and one for just 2013. If I select 2012 and 2013 it will just add them both in this expression. I need two different expressions.