Why doesn't the MoneyFormat script variable work? - qliksense

The script variable MoneyFormat is supposed to control the default format used for the Money function. It doesn't seem to work.  Why is that?
Set MoneyFormat = '$#,##0.00;-$#,##0.00';
...
LOAD
Money(Revenue, '$#,##0.00;-$#,##0.00') AS Revenue1, // OK: $123,456.78
Money(Revenue, '$(MoneyFormat)') AS Revenue2, // OK: $123,456.78
Money(Revenue) AS Revenue3, // Wrong: $123456.78
...
Edit:
I don't know how much of this is relevant, but to be clear, here are all of my settings instead of just MoneyFormat:
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 FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

EDIT: Doesn't work after all.... See comments
This looked like a simple problem, but it took me quite a while to actually solve it since the documentation doesn't really help at all.
The solution should be:
Replace this:
Set MoneyFormat = '$#,##0.00;-$#,##0.00';
with this:
Set MoneyDecimalSep='.';
Set MoneyThousandSep=',';
Set MoneyFormat='$ #,##0.00;$ -#,##0.00';
So in the end it's quite simple. I solved it by looking at the variable MoneyFormat and after a while I noticed the important difference between $ and € numbers and this took me to the missing variables.

Related

Cimplicity Screen - one object/button that is dependent on hundreds of points

So I have created a huge screen that essentially just shows the robot status for every robot in this factory (individually)… At the very end of the project, they decided they want one object on the screen that blinks if any of the 300 robots fault. I am trying to think of a way to make this work. Maybe a global script of some kind? Problem is, I do not do much scripting in Cimplicity, so any help is appreciated.
All the points that are currently used on this screen (to indicate a fault) have very similar names… as in, the beginning is the same… so I was thinking of a script that could maybe recognize if a bit is high based on PART of it's string name characteristic. The end will change a little each time, but I am sure there is a way to only look for part of a string and negate the rest. If the end has to be hard coded, that's fine.
You can use a Python script in Cimplicity.
I will not go into detail on the use of python in Cimplicity, which is well described in the documentation indicated above.
Here's an example of what can be done... note that I don't have a way to test it and, of course, this will work if the name of your robots in the declaration follows the format Robot_1, Robot_2, Robot_3 ... Robot_10 ... Robot_300 and it also depends on the Name and the Type of the fault variable... as you didn't define it, I imagine it can be an integer, with ZERO indicating no error. But if you use something other than that, you can easily change it.
import cimplicity
(...)
OneRobotWithFault = False
# Here you get the values and check for fault
for i in range(0, 300):
pointName = f'MyFactory.Robot_{i}.FaultCode'
robotFaultCode = cimplicity.point_get(pointName)
if robotFaultCode > 0:
OneRobotWithFault = True
break
# Set the status to the variable "WeHaveRobotWithFault"
cimplicity.point_set("WeHaveRobotWithFault", OneRobotWithFault)

Movesense, setting the system time

I am trying to set the system time in Movesense. I couldn't find an example of that, but based on the documentation I think that this should do:
asyncPut(WB_RES::LOCAL::TIME(),
AsyncRequestOptions::Empty,
(int64_t)0);
In this case, I'm just trying to reset the epoch to zero but onPutResults gives me
HTTP_CODE_BAD_REQUEST
So what is the right way?
Minimum timestamp seems to be 1483228800000000 us which corresponds to 1.1.2017. So you can't set the time to 70's as zero would set it to.
This should be documented in the yaml api but currently is not. We will add that to the list of tasks to make sure it's documented in the next release of device-lib.

SAPUI5: set Timepicker configuration for 15 min interval

Is is possible to configure the sap.m.TimePicker to display only 15 minute intervals?
At the moment the user can enter any time they like.
It's possible now with version 1.40.+
There was incorrect information in the API documentation and it wasn't possible even on version 1.38
Change it to a DropDownBox with a value range of 00:00, 00:15, 00:30, ... 23:30, 23:45? This makes the limitation to specific intervals clear at a glance, is easy to implement and avoids entry of undesired values altogether.
While #vwegert 's answer is function I think there is a better way where you you still get the look and feel of the TimePicker.
In the source of the control there is a property minutesStep. If you can set this in the xml or js definition I think you could be onto a winner.
In fact there is a setter (yay) setMinutesStep.
oTimer.setMinutesStep(15); should be a winner for you.
Hope that helps,
Nigel

how should I set <PrintWhenExperssion> value true or false from java code

I want to set
<printWhenExpression>![CDATA[Boolean.valueOf(true)]]</printWhenExpression>
to Boolean.valueOf(false) when I fill the report according to some conditions. This means I want to set value 'false' in <printWhenExpression> at run time. Can any one help me for this?
Instead of having hard coded value Boolean.valueOf(true)/Boolean.valueOf(false) use a variable which is evaluation to a boolean:
Boolean.valueOf(someVariableOfTypeBoolean)
or
Boolean.valueOf(someMethodThatReturnsBoolean())

Windows command line: setting global variables to each other

scenario further updated
Hi all:
I'm trying to set a global variable to another in windows command line batch language. The syntax I've tried is as below:
:: these are global vars
SET varThree=%varOne%\something
SET varOne=
SET varTwo=2
:Section
SET varOne=%varTwo%
::more setting of varOne to other global variables
GOTO Section2
:Section2
echo %varThree%
GOTO cleanup
:cleanup
SET varThree=
SET varTwo=
SET varOne=
The value of varOne seems to be lost when it comes to echoing %varThree%.
I was wondering how can I set the above variable properly?
TIA.
EDIT:
The cleanup section was there as a way to ensure the variables are being cleaned up upon exiting of the program. When I removed it, it took the 2nd run in order for varOne to lose its state. Likewise when I re-introduced it, it took the 2nd run for the state of varOne to come back. Any ideas why is this happening?
You don't use the percent signs on the left side.
Also, you might want to read about delay-expanded variables (like !varTwo! instead of %varTwo%), since you might run into problems with incorrect expansions.
See this link about delayed expansions: Cmd.exe Documentation
Edit: You're also missing a "Set" on the left, so this:
:Section
%varOne%=%varTwo%
Should really be:
:Section
Set varOne=%varTwo%
Try:
varOne=%varTwo%
You are wrong in looking for a "post-compiling" syntax.
In your scenario
SET varThree=%varOne%\something
cause varThree set with "\something", because varOne is not defined yet.
Speaking about your scenario, you have to use
echo %varOne%%varThree%
in ":section2".