取消
顯示結果 
搜尋替代 
您的意思是: 

Return month and year

已解決!
前往解決方案

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. 

 

0 積分
1 條訊息(共 9 條)
2,942 檢視

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

0 積分
2 條訊息(共 9 條)
2,927 檢視

thank you. 

any one with a solution please do help me. 

0 積分
3 條訊息(共 9 條)
2,903 檢視

so you wanted the vi.. here it is... the issue it after dec,2021, it does not really go to jan 2022.

 

0 積分
4 條訊息(共 9 條)
2,895 檢視

The previous vi showed number, this vi is basically what I really wanted with a correction to work for 2022 as well. 

0 積分
5 條訊息(共 9 條)
2,891 檢視

When your month becomes 13, subtract 12 and add 1 to the year!

0 積分
6 條訊息(共 9 條)
2,873 檢視

Solved it 

 

Now that a solution.. 

 

Ill attach it for you to refer

 

 

With regards

 

CALTECT

0 積分
7 條訊息(共 9 條)
2,872 檢視

@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).

0 積分
8 條訊息(共 9 條)
2,844 檢視
解決方案
由主題作者所接受 caltect

Try something like this:

 

altenbach_0-1614759433289.png

 

9 條訊息(共 9 條)
2,829 檢視