Skip to content

Instantly share code, notes, and snippets.

@ralfbecher
Last active October 21, 2015 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/97c20a727f12bb421921 to your computer and use it in GitHub Desktop.
Save ralfbecher/97c20a727f12bb421921 to your computer and use it in GitHub Desktop.
QlikView Chart Expression Counts New Products/Year
data:
LOAD * INLINE [
Year, Product
2010, P1
2011, P1
2012, P1
2010, P2
2011, P2
2011, P3
2012, P3
2010, P4
2011, P4
2011, P5
2012, P5
2013, P2
2013, P4
2013, P6
];
// Chart Expressions:
=Concat(Aggr(Product & ':' & Concat(DISTINCT Year, ','), Product), '/')
=SubStringCount(Concat(Aggr(Product & ':' & Concat(DISTINCT Year, ','), Product), '/'), ':')
// Resulting Data:
Year;New Prd:New Prd Cnt
2010;P1:2010,2011,2012/P2:2010,2011,2013/P4:2010,2011,2013;3
2011;P3:2011,2012/P5:2011,2012;2
2012;;0
2013;P6:2013;1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment