Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Karl_Hart
Contributor

Checking for Static Data

I have the need to see how long prices have been at the same value

So I may have a table

Month              Price

1. Jan               5.50

2. Feb              5.50

3. Mar               5.50

4. Apr               6.00

5. May               6.00

6. Jun               6.00

7. Jul               6.00

8. Aug               6.00

So in this above example we can see that the price has been at 6.00 for the last 5 months. I want to be able to calculate this figure for hundreds of different company / product combinations but I'm struggling to even begin.

I've thought about doing a big if statement saying something along the lines of

     If current price = price 12 months ago then 12,

          if current price = price 11 months ago then 11,

               ......etc etc

but this gets very big very quickly

Any thoughts?

Ultimately I want

Month Value of the last sales point (8)

-

Smallest month value where price = current price (4)

+1

= 5

2 Replies
YoussefBelloum
Esteemed Contributor

Re: Checking for Static Data

Hi,

would you be able to add more details like the complete data structure and what is the exptected output on the dashboard ? on what type of object you to show that value ?

Karl_Hart
Contributor

Re: Checking for Static Data

Youssef,

The end goal is for each customer / product combination I want to know how many months the sales price has been static.

Customer          Product               Months Since Price Rise

Cust A               Prod 1                    24

Cust B               Prod 2                    20

Cust A               Prod 2                    19

Cust C               Prod 3                    15

Cust B               Prod 1                    10