Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Helo guys,
So I have this SQL query that regurts a set of number (1,2,3,4,5,6....,1999,2000,2001) .
I would like to add to these results 3 more values, for example, if I have 1,2,3,4,5,6....,1999,2000,2001 and I add the values I would get 1,2,3,4,5,6....,1999,2000,2001,2002,2003,2004.
How can I achieve this?
Thank you in advance!!
Best regards.
Hello Márcio,
in attachment there is a dummy qvw file. I had to remove the sql query because it would not work for you and I simulate this with a excel file where I load the values from.
I have QV personal edition so I won't be able to open a file edited with another version
Thank you in advance.
Best regards.
Hi,
Try like this
QV_Table:
Sql Select Sequence,Number,Time From Table;
MaxValue:
LOAD
Max(Sequence) AS MaxSequence
RESIDENT QV_Table;
LET vMaxSequence = Peek('MaxSequence');
DROP TABLE MaxValue;
Concatenate(QV_Table)
LOAD
$(vMaxSequence) + RecNo() AS Sequence
Autogenerate(3);
Hope this helps you.
Regards,
Jagan.
Ok I finally understood how to use the example you guys provided, but is does not solve the problem, I still do not have the extra 3 values.
Hi,
Try this sample script
QV_Table:
LOAD
*
INLINE
[
Sequence, Dim
100,abc
101,def
102,ghi ];
MaxValue:
LOAD
Max(Sequence) AS MaxSequence
RESIDENT QV_Table;
LET vMaxSequence = Peek('MaxSequence');
DROP TABLE MaxValue;
Concatenate(QV_Table)
LOAD
$(vMaxSequence) + RecNo() AS Sequence
Autogenerate(3);
I am getting additional records with 103, 104 and 105.
Regards,
Jagan.
Hi Jagan,
So your solution worked well and I can add my extra three values to the query, but now I am wondering, what if I want to do someting like this (the N/A values forced):
Try this script
Concatenate(QV_Table)
LOAD
$(vMaxSequence) + RecNo() AS Sequence,
'N/A' AS Knr,
'N/A' AS time
Autogenerate(3);
Regards,
Jagan.
Thank you Jagan, it works well enough