Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

filling blank dates with previous data

CLIENT NOCLIENT NAME DATECCY PROD TYPEAMOUNT
010000000ASDFG1/1/2012EURLRP56,987
010000001ASDFGDSF2/1/2012USDFGT54,785
010000002ASDFASDFASDF3/1/2012USDBGO62,314
011000003ASDSASDE4/1/2012USDPBG56,987
011000004SADEDSA6/1/2012USDPBG25,558
011000005ASEDF7/1/2012USDPBG69,874
011000006ASDFTED8/1/2012USDPBG58,461
011000007ADSFE12/1/2012USDBGO56,987
011000008FAFOOOASF13/1/2012USDBGO54,785
011000009ADSFLLLL14/1/2012USDBGO62,314
011000010ADLFOPP15/1/2012USDBGO23,268
011000011AFQER16/1/2012USDBGO23,654
011000012INTER LTD.17/1/2012USDBGO2,828
011000013VSAFD23/1/2012USDBGO56,987
011000314ASDFRRYGFS24/1/2012EURBGO54,785
011200015ADSFACVR25/1/2012SARBGO62,314
011200216ASDFEFCC26/1/2012SARBGO23,268
011200517ADSFVHT27/1/2012USDPBG56,987
011200618AQEWER28/1/2012USDPBG54,785
011200619CVREFASDF29/1/2012USDPBG62,314
011200620ASDFCWE30/1/2012USDPBG56,987

Hi

I have a following data, in this data i have some dates missing like  5/1/2012 , 9-11/1/2012, 18-22/1/2012 these are the holydays and  there is no data in them what i want is that in these dates the previous date customers data should be copied. i need the script for. if there is a difference of one date like 5/1/2012 in that i need the data of 4/1/2012 and from 9-11/1/2012 i need the data of 8/1/2012

i have used date dimension too.

1 Solution

Accepted Solutions

Re: filling blank dates with previous data

See attached qvw for a possible solution.


talk is cheap, supply exceeds demand
3 Replies
jonbrough
Valued Contributor

Re: filling blank dates with previous data

I think you can alter the script in the following post that accumulates data based on a combination of dimensions and dates (http://community.qlik.com/message/16104#16104).

If you reload your table with an 'Order By Date Desc' clause, testing for an AccumulationKey (just date, or date plus relevant dimensions) you should be able to determine when a date is missing and when you have to roll over to the previous date.

Jonathan

Re: filling blank dates with previous data

See attached qvw for a possible solution.


talk is cheap, supply exceeds demand
Not applicable

Re: filling blank dates with previous data

Thanks Gysbert  for the reply it is working good in one customer but what if there are more then one records in that date like

CLIENT NO, CLIENT NAME,  DATE, CCY, PROD TYPE, AMOUNT

 

    011000003, ASDSASDE, 4/1/2012, USD, PBG, "56,987"

    010000001, ASDFGDSF, 4/1/2012, USD, FGT, "54,785"

     011000007, ADSFE, 4/1/2012, USD, BGO, "56,987"

    011000008, FAFOOOASF, 4/1/2012, USD, BGO, "54,785"

    011000009, ADSFLLLL, 4/1/2012, USD, BGO, "62,314"

i have tried and did modifications in the script but it didn't work can you please help me in this

Community Browser