Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

generate records according create time and complete time.

hi all
need your help here

I have some records like below, every records has a error data and a close date.   

table A:

IDerro dateclose date
10012015/1/12015/1/3
10022015/2/12015/2/5

I want to generate more records if the close date is bigger than error date. for this sample I wan this below

   table B:

IDerror dateclose date
10012015/1/12015/1/3
10012015/1/22015/1/3
10022015/2/12015/2/5
10022015/2/22015/2/5
10022015/2/32015/2/5
10022015/2/42015/2/5

My question is could I write scripts to generate B through load from table A.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD ID,

  [close date],

  Date([erro date] + IterNo() - 1) as [erro date]

While ([erro date] + IterNo() - 1) < [close date];

LOAD * Inline [

ID, erro date, close date

1001, 2015/1/1, 2015/1/3

1002, 2015/2/1, 2015/2/5

];


Capture.PNG

View solution in original post

6 Replies
sunny_talwar

Try this:

Table:

LOAD ID,

  [close date],

  Date([erro date] + IterNo() - 1) as [erro date]

While ([erro date] + IterNo() - 1) < [close date];

LOAD * Inline [

ID, erro date, close date

1001, 2015/1/1, 2015/1/3

1002, 2015/2/1, 2015/2/5

];


Capture.PNG

Kushal_Chawda

Data:

load ID,

       [Close date],

       [error date]+iterno()-1 as [error date]

From TableA

while [error date]+iterno()-1<= [Close date]

Not applicable
Author

Thank you Sunny , it works. 

Not applicable
Author

I really want but I don’t know how to mark it.

Best wishes and good luck!

Name: Jax Tang

Position: EBI Pre-Sales/Project Manager

Phone: 13681627057

发件人: Sunny T <qcwebmaster@qlikview.com>

答复:

<jive-892447235-3jqn-2-jsu0@qliktech-public-v7.hosted.jivesoftware.com>

日期: Wednesday, 2 December, 2015 12:36 am

至: Jax tang <jax.tang@ebistrategy.com>

主题: Qlik Community: New reply - generate records according create time

and complete time.

You've received a new response to your question: generate records according

create time and complete time.

<https://community.qlik.com/message/923832#923832>

Please take a minute to log in to Qlik Community

<https://community.qlik.com/welcome> , review the responses, and mark any

Helpful or Correct answers.

You can mark up to two helpful answers and one correct answer. This rewards

other members for taking the time to assist you.

Best Regards,

Qlik Community Management

Comment by replying to this email, or go to the question on Qlik Community

<https://community.qlik.com/message/923832#923832>

No longer wish to receive these emails? Go to your email preferences

<https://community.qlik.com/user-preferences!input.jspa> and turn off the

setting for "Social activity directed at you, such as @mentions, shares, and

messages".

(C) 1993-2015 QlikTech International AB | Copyright & Trademarks

<http://www.qlikview.com/us/info/copyright> | Privacy

<http://www.qlikview.com/us/info/privacy> | Terms of Use

<http://www.qlikview.com/us/info/terms-of-use> | Software EULA

<http://www.qlikview.com/us/info/software-eula>

sunny_talwar

Mark it? Mark what?

Not applicable
Author

I know how to mark a useful answer now! thanks again!