Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

stright table ?

Datesales
1/1/2014100
12/1/2014200
2/3/2015222
12/1/2015323
4/5/2016345
12/1/2016444
12/23/2016789

Hi I have one table with above 2 columns ,

i have ploted a stright table with dimension is Date  and measure is sum(sales),  here my requirmnet isi have to create another expression

with calculation is

sum(sales)/previous year highest month sales which means

formula:

sum(sales)/previous year highest month sales

ex:

when Date is 1/1/2014 it will look for previous year highest month ,in that case it doesn't have any year values  so it is going to be blank.

like wise

if u see for  2/3/2015 values is    222

and previous year value is 200

here the calculation should be like  222/200

like this i want write a expression for dynamic calculation

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

here you go.

have a look at attached qvw.

hope this helps

View solution in original post

8 Replies
tripatirao
Creator II
Creator II

Hi ,

Please refer this.

From this you can get solution

Peek() vs Previous() – When to Use Each

Not applicable
Author

Hi,

Thanks for looking in to this

i want do this in straight table

Frank_Hartmann
Master II
Master II

hi,

have a look at the attached sample.

hope this helps!

Not applicable
Author

Hi Frank Hartmann,

It is very close to the result,

its giving result as per current data ,if I add more records then giving wrong result,

let say I have added one more record called   12/10/2015    330

in this case ur picking max value but I want choose the max date value(not maximum value)

pls let me know if ur not understanding myrequirement

hemachandran
Partner - Creator
Partner - Creator

Hi Frank Hartmann,

You need to pick previous year max date value..In your case...

Frank_Hartmann
Master II
Master II

Im not sure what you expect if you add the line

12/10/2015    330

like this?

if not, please show expected output!

Not applicable
Author

hi Frank,

when I add new record called   12/10/2015  300 (not 330)

in this ur picking max value which will  pick the date of (12/01/2015) but my intention is pick the max date value (12/10/2015)

Frank_Hartmann
Master II
Master II

here you go.

have a look at attached qvw.

hope this helps