Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Vidit
Creator
Creator

Hi, please help with the set analysis expression?

I need to write an ecpression so that the previous Qtr is also visible with the selected.

PFA for more details.

 

Year

Qarter

Period

PRODUCT

COUNT

2015

Q4

Q4 2015

D

30

2016

Q1

Q1 2016

A

20

2016

Q1

Q1 2016

B

15

2016

Q1

Q1 2016

C

12

2016

Q1

Q1 2016

D

19

2016

Q2

Q2 2016

A

18

2016

Q3

Q2 2016

B

16

2016

Q4

Q2 2016

C

0

2016

Q1

Q2 2016

D

13

 

Thanks in advance.

 

4 Replies
swuehl
MVP
MVP

Maybe use something like

=sum({$+1<Prod = {'D'},PeriodNum={$(=Max(PeriodNum)-1)}>}Count)

[having PeriodNum created in the script to get an easier access to the previous period.]

Vidit
Creator
Creator
Author

Hi,

Thanks for your reply, its very close to what I need.

do you think we can do something to hide the highlighted white space, in this solution.

swuehl
MVP
MVP

I think that's the default Qlik behaviour for two dimensions in group style mode.

One option would be to use a single dimension (e.g. by concatenating your current two into a single one)

Vidit
Creator
Creator
Author

Hi,

What if another column Div is added to the table.

How to include that in

sum({$+1<Prod = {'D'},PeriodNum={$(=Max(PeriodNum)-1)}>}Count

Please suggest