Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have some records for my company's sales as below:
Date | Amt | Sales |
01/01/2018 | 100 | Sales A |
01/01/2018 | 200 | Sales B |
01/02/2018 | 500 | Sales A |
01/05/2018 | 400 | Sales 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?
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))
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))