Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
For selected date if the values is not available then get previous nearest date value.
How to achieve this?
Reards,
Prajna
You can get that using peek() in the script. Have a look here: Generating Missing Data In QlikView
Use of Previous/Peek function you can replace the Null Data with previous one.
If you share your sample file or apps, we can help you in better way.
well the requirement is i need to show balance or that particular day.if there is no balance available the i should consider previous day balance.
Say apr 14 we have balance ,apr 15 we have,ap 18 we have
so now apr 16 and 17 should have 15 data(balance)
balance needs to be carried forwad.
Regards,
Prajna
Sample Script enclosed...
======
TempTable:
LOAD Item, Date, IF(Len(Trim(Balance))=0,Null(),Balance) as Balance Inline
[
Item, Date, Balance
A, 01/10/2010, 100
A, 02/10/2010, 10
A, 03/10/2010,
B, 24/10/2010, 150
B, 25/10/2010,
B, 26/10/2010, 80
];
Table:
NoConcatenate
Load
If(IsNull(Item),Peek(Item),Item) as Item,
Date,
If(IsNull(Balance), Peek(Balance), Balance) as Balance
Resident TempTable
Order By Date;
Drop Table TempTable;
=======
A little modification needed in Manish's script
====
TempTable:
LOAD Item, Date, IF(Len(Trim(Balance))=0,Null(),Balance) as Balance Inline
[
Item, Date, Balance
A, 01/10/2010, 100
A, 02/10/2010, 10
A, 03/10/2010,
B, 24/10/2010, 150
B, 25/10/2010,
B, 26/10/2010, 80
];
Table:
NoConcatenate
Load
If(IsNull(Item),Peek(Item),Item) as Item,
Date,
If(IsNull(Balance),If(Item=Peek(Item),Peek(Balance),0), Balance) as Balance
Resident TempTable
Order By Date;
Drop Table TempTable;
=======
Else if the first row of customer B has no Balance value, it will take the previous balance value which is for A, so it will go wrong.