Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

Outer set expression combined with pick(match(

I want to compare the current month with the previous month.

The result is build up from a Pick Match, where the master items T1A etc are the KPI calculations with there own calculations with set analysis in it.

Current month:

{<_YearMonth_serial = {"$(=Max(_YearMonth_serial))"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C)

Previous month:

{<_YearMonth_serial = {"$(=Max(_YearMonth_serial)-1)"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C)

The result is het sum [Current month] - [Previous month] by combining both statement as 1 measure like this:

{<_YearMonth_serial = {"$(=Max(_YearMonth_serial))"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C)

- (minus)

{<_YearMonth_serial = {"$(=Max(_YearMonth_serial)-1)"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C)

This does not work because it are 2 different outer set operators. At least, I have not found a way to make it work. 

Do yo have solution? Thanks

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

I'm not entirely sure what the issue here is, but have you tried using:

RangeSum({<_YearMonth_serial = {"$(=Max(_YearMonth_serial))"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C) , -{<_YearMonth_serial = {"$(=Max(_YearMonth_serial)-1)"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C))

View solution in original post

1 Reply
Or
MVP
MVP

I'm not entirely sure what the issue here is, but have you tried using:

RangeSum({<_YearMonth_serial = {"$(=Max(_YearMonth_serial))"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C) , -{<_YearMonth_serial = {"$(=Max(_YearMonth_serial)-1)"}>} Pick(Match('$(T1orT2)', 'T1','T2','T2_S1'), T1A, T2A, T2C))