Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm very new to Qlik, so please forgive me if I ask stoopid questions 🐵
I have loaded a table which has one record:
Month
01/01/2010 // date format dd/mm/yyyyy
Payment
100.00 // monthly payment
Number of payments
36 // number of months the payment will be made from the first date
I want to create this record in another table with 36 rows of data, one for each payment month.
So i want to code something like :
FOR i = 1 to $[Number of payments]
Insert into NEWTABLE
Month + i, // add number of months to the first date
Payment
NEXT i
Is this possible? Do you have any pointers as to where to find the code to implement this?
Many thanks & kind regards,
Phil
Hello Phil,
I'd rather use something like
storing that "36" in one variable and month starting date in the other. You only need to change in the code above 'Name of the table' for the actual name. Peek function returns in this case first (0) value of field indicated in table.SET vNoPmts = PEEK('Number of Payments', 0, 'Name of table'); SET vPmtStartingMonth = PEEK('Month', 0, 'Name of table');
Now you are able to
Payments:LOAD RowNo() AS PmtNo, AddMonths($(vPmtStartingMonth), RowNo()) AS DueDateAUTOGENERATE($(vNoPmts));
Please note that the code above is untested, so some changes may be neccesary.
Hope this shed some light in your needs.
Hi Miguel,
Many thanks for your quick reply, this works perfectly!
Thank you very much for your help.
Phil