Robert Fuschetto 2 Posted December 12, 2023 Share Posted December 12, 2023 I believe I did this years ago but cannot find the fex. I want to create a hold file. The result will be a single row with 'Units' summed. I want to store the single resultant units to a variable. I then want to do an IF Units> 0 Then run fex1 Else run fex 2.I do not recall how I did this and cannot find anything in the guide.Thanks! Link to comment Share on other sites More sharing options...
Patrick Huebgen 2 Posted December 12, 2023 Share Posted December 12, 2023 @Robert Fuschetto Just discussed this in another topic - https://community.spotfire.com/s/question/0D74z00000BI1yrCAD/ here's the sample code-SET &HOW_MANY = 0;TABLE FILE CARSUM COMPUTE HOW_MANY/I11=CNT.SALES ;ON TABLE HOLD AS TEST FORMAT ALPHAEND-RUN-READFILE TEST-TYPE HOWMANY &HOW_MANY Link to comment Share on other sites More sharing options...
Mat Barnard Posted December 12, 2023 Share Posted December 12, 2023 -IF &HOW_MANY GT 0 THEN GOTO :WE_HAVE_RECS ELSE GOTO :WE_HAVE_NO_RECS; -:WE_HAVE_RECS EX WE_HAVE_RECS -EXIT -:WE_HAVE_NO_RECS EX WE_HAVE_NO_RECS -EXITYou can swap out the EX for INCLUDE if you so chose. Link to comment Share on other sites More sharing options...
Mat Barnard Posted December 12, 2023 Share Posted December 12, 2023 Or even:-SET &EX = IF &HOW_MANY GT 0 THEN 'WE_HAVE_RECS' ELSE 'WE_HAVE_NO_RECS'; EX &EX Link to comment Share on other sites More sharing options...
Robert Fuschetto 2 Posted December 12, 2023 Author Share Posted December 12, 2023 Thanks..actaully I really just need to evaluate and set a variable to a string and then use the string in my page header!Something like: MESSAGE A200 = IF UNITS < 100 THEN 'Note full refresh has not completed' ELSE 'Refresh Completed' Link to comment Share on other sites More sharing options...
Patrick Huebgen 2 Posted December 12, 2023 Share Posted December 12, 2023 @Robert Fuschetto Even easierTABLE FILE CARSUM SALES COMPUTE MESSAGE/A200= IF SALES LT 300000 THEN 'Note full refresh has not completed' ELSE 'Refresh Completed'; NOPRINTHEADING"<MESSAGE"END Link to comment Share on other sites More sharing options...
Patrick Huebgen 2 Posted December 12, 2023 Share Posted December 12, 2023 Or the Amper version-SET &MESSAGE = 0; TABLE FILE CAR SUM SALES COMPUTE MESSAGE/A200= IF SALES LT 300000 THEN 'Note full refresh has not completed' ELSE 'Refresh Completed'; NOPRINT ON TABLE HOLD AS TEST FORMAT ALPHA HEADING "<MESSAGE" END -RUN -READFILE TEST -TYPE MESSAGE &MESSAGE Link to comment Share on other sites More sharing options...
Robert Fuschetto 2 Posted December 12, 2023 Author Share Posted December 12, 2023 THANKS! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now