Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I am trying to solve the chapter 12 Use case in Qlikview 11 for developers - What happens if all we have is a start date
Trying to achieve this- "peek" at the start value from the next record, subtract one day and that will be our new end date by
loading from QVD with out the End date and adding the end date by ordering and peeking - but getting the end date as spaces..
[Initial Load]:
LOAD [%Airline ID],
[Carrier Code],
[Carrier Entity],
[Carrier Name],
[Unique Carrier Code],
[Unique Carrier Entity],
[Unique Carrier Name],
[Carrier World Area Code],
[Carrier Group ID (Old)],
[Carrier Group ID],
[Region Code],
[Start Date]
//[End Date]
FROM
[..\3.QVD\Source\Carrier Decode.qvd]
(qvd);
Temp_Carrier_decode:
LOAD
[%Airline ID],
[Carrier Code],
[Carrier Entity],
[Carrier Name],
[Unique Carrier Code],
[Unique Carrier Entity],
[Unique Carrier Name],
[Carrier World Area Code],
[Carrier Group ID (Old)],
[Carrier Group ID],
[Region Code],
[Start Date],
if(
[Unique Carrier Entity] = Peek('Unique Carrier Entity',RowNo()+1,'Temp_Carrier_decode'), Date(Peek('Start Date',RowNo()+1,'Temp_Carrier_decode')-1), ' '
) as [End Date]
Resident [Initial Load]
Order By [Unique Carrier Code],[Start Date] desc;
Drop Table [Initial Load];
maybe
if([Unique Carrier Entity] = Peek('Unique Carrier Entity'), Date(Peek('Start Date') -1), '') as [End Date]
May be try this:
If([Unique Carrier Entity] = Peek('Unique Carrier Entity'), Date(Peek('Start Date') - 1), ' ') as [End Date]
maybe
if([Unique Carrier Entity] = Peek('Unique Carrier Entity'), Date(Peek('Start Date') -1), '') as [End Date]
Thank you Sunny,Maxgro, this works if we order in descending order and peeking previous, any means to peek next record ( by keeping the sort in ascending).
I don't think this can work without changing the sort order.Why are you reluctant to change the sort order to descending? It won't have any change on the front end except for anywhere you use Aggr function.
Thank you Sunny, just wanted to know if it was feasible. this helps