Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
yipchunyu
Creator
Creator

Calculate the date which sales break target

I have some records for my company's sales as below:

DateAmtSales
01/01/2018100Sales A
01/01/2018200Sales B
01/02/2018500Sales A
01/05/2018400Sales A

 

I want to know the date which the sales break certain target e.g. 100000, 150000

e.g. After certain calculation, Sales A passed 100000 on 6/6/2018, 150000 on 9/3/2018 and Sales B passed 100000 on 12/15/2018 ....

How can I do it in Qlikview?

 

2 Replies
jyothish8807
Master II
Master II

Hi Yip,

Try this:

A:
LOAD * INLINE [
Date, Amt, Sale
01/01/2018, 100, Sales A
01/01/2018, 200, Sales B
01/02/2018, 500, Sales A
01/05/2018, 400, Sales A
01/10/2018, 900, Sales B
];


B:
NoConcatenate
Load
Date,
Amt,
Sale,
if(Sale=Previous(Sale),peek(NewAmt)+Amt,Amt) as NewAmt
Resident A
Order by Sale,Date;
drop table A;

 

At UI create a straight chart,

Dimension : Sale

exp: FirstSortedValue(Date,-if(NewAmt >=1000,NewAmt))

Best Regards,
KC
yipchunyu
Creator
Creator
Author

I changed the expression from 1000 to 100 but still found the same values in the FirstSortedValue, any reason for this?

FirstSortedValue(Date,-if(NewAmt >=100,NewAmt))