Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
rajtechnocraft
New Contributor III

Current value/previous value thru set analysis help required

Hi Experts, Just wanted help in calculating previous value. I am having sum of sales as my expression It will always show me current value What i want to do is add one more expression which is previous sales . I don't want to do this at script level but at frontend using set analysis The calculation of current /previous value will be based on date selection. Ex if i select today's date then previous should show me yesterdays sale. Pls help. Regards Raj

2 Replies
chauhans85
Esteemed Contributor

Current value/previous value thru set analysis help required

load

Year ,

peek(Year ) a previous

sales

from path;

in expression

sum({<Year={$(=Only(Year)}>} sales) - current value

sum({<Year={$(=Only(previous)}>} sales) -previous valuee

or

tab1:

Load

Year,

sales

from path

let var=peek('fieldname',-1,Tablename);

in expression

sum({<Year={$(=Only(Year)}>} sales) - current value

sum({<Year={$(var}>} sales) -previous value

hope this helps

chauhans85
Esteemed Contributor

Current value/previous value thru set analysis help required

use this for previous calculattion

=sum({<Day= {'$(=Date(max({<Day = {"<$(=max(Day))"}> } Day)))'}>}  Price)


Community Browser