Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help

Hi All,

I have have uploaded source file and the expected output file.

Please help me get the desired result.

My requirement is whenever the field US WD is zero, corresponding date should be last non zero(US WD)

date like below.

DateUS WDExpected output
05/22/2015105/22/2015
05/23/2015005/22/2015
05/24/2015005/22/2015
05/25/2015005/22/2015
05/26/2015105/26/2015

Any suggestions appreciated.

Thanks& Regards

Jyothi

1 Solution

Accepted Solutions
sunny_talwar

Try this:

I am not using your output file. I am creating this in the script (Changed Required to ABC)

Table:

LOAD *,

  If([US WD] = 0, Alt(Peek('ABC'), DAY), DAY) as ABC;

LOAD DAY,

    [US WD]

FROM

Community_164851.xlsx

(ooxml, embedded labels, table is Sheet1);

View solution in original post

18 Replies
sunny_talwar

Try this script:

Table:

LOAD *,

  If([US WD] = 0, Alt(Peek('Required'), DAY), DAY) as Required;

LOAD DAY,

     [US WD]

FROM

Community_164851.xlsx

(ooxml, embedded labels, table is Sheet1);

sunny_talwar

Output Table Box:

Capture.PNG

Not applicable
Author

Hi Sunindia,

Thanks for your reply.

How can i use the 'Required' field in the Peek function.?

I have only DAY and US WD fields in my source excel.

in Expected output excel i have manually entered 'Required' field..

Any suggestions?

Thanks

sunny_talwar

I am using Alt function here which takes care of the required not being there the 1st time. After the first row is created, you have a required field now.

Does that make sense?

sunny_talwar

Try this:

I am not using your output file. I am creating this in the script (Changed Required to ABC)

Table:

LOAD *,

  If([US WD] = 0, Alt(Peek('ABC'), DAY), DAY) as ABC;

LOAD DAY,

    [US WD]

FROM

Community_164851.xlsx

(ooxml, embedded labels, table is Sheet1);

Not applicable
Author

Thank you for making me understand

i will try the same and let you know.

Thanks.

sunny_talwar

Sure thing.

Best,

Sunny

Not applicable
Author

Awesome! Its working. I have been struggling with this since 2 days. I did a mistake by uploading in community late

Thank You so much

Jyothi

Not applicable
Author

Really useful thanks