Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all
need your help here
I have some records like below, every records has a error data and a close date.
table A:
ID | erro date | close date |
1001 | 2015/1/1 | 2015/1/3 |
1002 | 2015/2/1 | 2015/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:
ID | error date | close date |
1001 | 2015/1/1 | 2015/1/3 |
1001 | 2015/1/2 | 2015/1/3 |
1002 | 2015/2/1 | 2015/2/5 |
1002 | 2015/2/2 | 2015/2/5 |
1002 | 2015/2/3 | 2015/2/5 |
1002 | 2015/2/4 | 2015/2/5 |
My question is could I write scripts to generate B through load from table A.
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
];
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
];
Data:
load ID,
[Close date],
[error date]+iterno()-1 as [error date]
From TableA
while [error date]+iterno()-1<= [Close date]
Thank you Sunny , it works.
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>
Mark it? Mark what?
I know how to mark a useful answer now! thanks again!