03-02-2021 09:56 PM
Hi All,
I am new to LabVIEW.
I have an array which calculates the return of investment. Currently I am extracting month and year from the excel. But I want to display the month and year without extracting it from excel.
Example
Date of solar installation: 1st march 2018
Input the number of months : 10
In period column I want to output from march 2018 to January 2019 (10 month).
I am not sure how to do that. I have also attached a snapshot of it.
Solved! Go to Solution.
03-02-2021 10:26 PM
Sigh -- I'd expect a more cogent question from someone who chooses a Forum Name of "caltect".
It is unclear (to me) what you are using as the "input" (is it a string that is of the form "1st March 2018", and you need to parse it into "Month" and "Year", or it is a number that represents the Date according to some (unspecified) Algorithm (for example, an Excel Timestamp or a LabVIEW Timestamp), or "something else".
Assume you specify the nature of the input, and can "solve the problem" of isolating a string called "Month" and a numeric called "Year". Can't you figure out how to generate a list of 10 "Dates" of the form <Mon>-<Year>, where <Mon> is a string representing the first three letters of a Month and <Year> is a string representing the Year as a 4-digit integer? You'd need to figure out how to "go to the next month" and also how/when to "go to the next year".
With a name like Caltect, can't you do this?
Go ahead, take a piece of paper, write down some steps, then learn enough LabVIEW (a couple of Beginning LabVIEW tutorials should suffice) and try to do it yourself in LabVIEW. If you are still stuck, come back here and post your VI (the actual file with the extension ".vi") so we can see what you tried.
Bob Schor
03-02-2021 10:44 PM
thank you.
any one with a solution please do help me.
03-02-2021 11:03 PM
so you wanted the vi.. here it is... the issue it after dec,2021, it does not really go to jan 2022.
03-02-2021 11:08 PM
The previous vi showed number, this vi is basically what I really wanted with a correction to work for 2022 as well.
03-03-2021 12:05 AM
When your month becomes 13, subtract 12 and add 1 to the year!
03-03-2021 12:05 AM
Solved it
Now that a solution..
Ill attach it for you to refer
With regards
CALTECT
03-03-2021 01:38 AM - edited 03-03-2021 01:59 AM
@caltect wrote:
Solved it
Did you even test it? Your "no of months" input is the wrong representation and you get duplicate and missing output elements (Try with a start time of Jan 31, 2021, for example, and Feb will be missing).
03-03-2021 02:19 AM