Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Period of format '4q 2017' and i want to go to '3q 2017' . by maxstring(period) i get '4q 2017' but how should i reach to '3q 2017'.
I tried maxstring(period)-1 but it doesnt work.
Any solution on this??
How did you create this field in the script? Could you post that statement?
I textbox i wrote
=MaxString(Period)
which provided output as 4Q 2017
for secondtextbox i wrote
=MaxString(Period)-1
which gives blank result
Thanks for the information. However, that didn't answer my query above. Could you post your sample qvw? You have to understand how maxstring() works; what the field type you are applying this expression to get the expected output. If you want one quarter back value by simply subtracting 1, then your field has to be created in the script accordingly; and that is probably a dual field and not just as a string. If you can share your sample app, we may help you suggesting a solution fits for your case.
Hi,
PFA the sample Qv file.
Yours is text field. Ideally this should have been created in the script as a dual field. However, to deal with this in the UI there would be many ways like using complex if..then..else along with string functions. I used another way of parsing the date and then to apply date functions..
=Ceil(Month(AddMonths(MakeDate(Right(Period,4),left(Period,1)*3),-3))/3) &'Q ' & Year(AddMonths(MakeDate(Right(Period,4),left(Period,1)*3),-3))
This doesnt work in my data . Only Q is shown as result. and its working in the sample data provided
Dear Amita,
That mostly like means, your sample data is not really representative sample of your actual data. And without knowing that (how your actual data is), it would be very hard for us to keep guessing and suggesting a probable solution. I would rather suggest you to provide more information about your data, or get the logic what I suggested above and try to solve yourself from there onward.
Thanks