Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
///$tab Load Scenario
//If user selected a scenario to view
If $(vLoadScenarios) then
//Set variables
LET vLoadScenarios = 0;
LET vShowScenarios = 0;
//Load selected scenario
Scenario:
LOAD *
FROM Scenarios.qvd (qvd)
Where ScenarioKey = '$(vLoadScenario)';
LET vStudentName = peek('StudentName', 0, 'Scenario');
LET vClass = peek('Class', 0, 'Scenario');
LET vDOB = peek('DateOfBirth', 0, 'Scenario');
LET vScore1 = peek('Score1', 0, 'Scenario');
LET vScore2 = peek('Score2', 0, 'Scenario');
LET vScore3 = peek('Score3', 0, 'Scenario');
LET vScore4 = peek('Score4', 0, 'Scenario');
LET vScore5 = peek('Score5', 0, 'Scenario');
Drop Table Scenario;
//Load QVDs that has been stored
//Check size of QVD
LET vSize = filesize('Scenarios.qvd');
//If the QVD exists
IF Not IsNull(vSize) then
Scenarios:
LOAD *
FROM
Scenarios.qvd
(qvd);
END If
Exit Script;
Else
//If user is entering a scenario
///$tab Main
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
//Scenario key
LET vNow = Now();
LET vNowNum = num('$(vNow)');
LET vScenarioKey = vStudentName & '_' & vDOB &'_'& vClass &'_'& vNow;
///$tab Scenario
//Load entered scenario
Scenarios:
Load
'$(vScenarioKey)' as ScenarioKey,
'$(vNowNum)' as ScenarioDate,
'$(vStudentName)' as StudentName,
'$(vClass)' as Class,
Date('$(vDOB)', 'M/D/YYYY') as DateOfBirth,
$(vScore1) as Score1,
$(vScore2) as Score2,
$(vScore3) as Score3,
$(vScore4) as Score4,
$(vScore5) as Score5
AutoGenerate (1);
///$tab Load and Store
//If recalc and save button was clicked
if $(vSave) then
SET vSave=0;
SET vFirstReload=1;
//Load QVD that has been stored
//Check size of QVD
LET vSize = filesize('Scenarios.qvd');
//If the QVD exists
IF Not IsNull(vSize) then
Scenarios:
LOAD *
FROM
Scenarios.qvd
(qvd);
END If
//Store table into QVD
STORE Scenarios into Scenarios.qvd (qvd);
End If
///$tab End If
End If
Hi,
What is your question ? Do you have an issue with your script ?
François
HI Francois,
I am testing Loading data into Input Boxes...
when i am reload this script it showing syntax errpor.
is any thing wrong...
Syntax error, missing/misplaced FROM:
Scenarios:
Load
'___12/23/2014 8:40:11 AM' as ScenarioKey,
'41996.361238426' as ScenarioDate,
Thanks in Advanvce...
Can you test that :
Load
'$(vScenarioKey)' as ScenarioKey,
'$(vNowNum)' as ScenarioDate,
'$(vStudentName)' as StudentName,
'$(vClass)' as Class,
Date('$(vDOB)', 'M/D/YYYY') as DateOfBirth,
'$(vScore1)' as Score1,
'$(vScore2)' as Score2,
'$(vScore3)' as Score3,
'$(vScore4)' as Score4,
'$(vScore5)' as Score5
AutoGenerate (1);
It will work !
François
Yes, François, you're spot-on. Just put the very last quote outside of the parentheses.
Oh yeah !!! What is this scorie !
Sorry about that 😉
François
Hi,
Try this script in your Scenerio tab:
//Load entered scenario
Scenarios:
Load
Num#('$(vScenarioKey)') as ScenarioKey,
num#('$(vNowNum)') as ScenarioDate,
num#('$(vStudentName)') as StudentName,
num#('$(vClass)') as Class,
Date('$(vDOB)', 'M/D/YYYY') as DateOfBirth,
num#('$(vScore1)') as Score1,
num('$(vScore2)') as Score2,
num#('$(vScore3)') as Score3,
num#('$(vScore4)') as Score4,
Num#('$(vScore5)') as Score5
AutoGenerate (1)
;
Please mark this as a correct answer to close the thread.
Thanks.
Hi,
Please mark the best response as a correct answer to close the thread.
Thanks
François