Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am doing some very simple calculations on load, but rather than a number the result is a '-' but this only occurs on the numbers generated from an applied map field where I substitute a number where none is available from the mapping table.
Would be most grateful if you can shed any light on why this may be....
Hi there GP
While you are clutching at straws I though I might make a simple suggestion. Seeing as the following all evaluate to a "-":
But Num#(Text(2))/2 evaluates to 1. Perhaps try using If(Pages < 3, Num(1), Num#(Pages)/2 AS totPages in the Jobs preceding load. It actually seems as if the Mapping table might be returning a string.
You can obviously try and make the values in the mapping table numbers (instead) of strings as well, but the suggestion above should easily show you whether it is in fact being seen as a string.
Good luck!
I believe as @Mauritz_SA suggested, that your mapping table values are strings. Try wrapping the value in Num() when you load the mapping table.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
This does seem to be strange behavior.
I would suggest two things:
I've tried various things, the 'totPages' column was to see what happened when I divide 'pages' by 2 and that is where it is failing, even though the pages column seems to be populated with correct numbers.
I've also tried loading Num(Pages) and all other figures involved defined as numbers.
There are no NULL values but the mapping table doesn't have a value for all entries. Here's how it's mapped.
Now clutching at straws...
Hi there GP
While you are clutching at straws I though I might make a simple suggestion. Seeing as the following all evaluate to a "-":
But Num#(Text(2))/2 evaluates to 1. Perhaps try using If(Pages < 3, Num(1), Num#(Pages)/2 AS totPages in the Jobs preceding load. It actually seems as if the Mapping table might be returning a string.
You can obviously try and make the values in the mapping table numbers (instead) of strings as well, but the suggestion above should easily show you whether it is in fact being seen as a string.
Good luck!
I believe as @Mauritz_SA suggested, that your mapping table values are strings. Try wrapping the value in Num() when you load the mapping table.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
This seems to have done the trick, the mapping table was evaluating as text, I've attached a screen shot of what worked. Appreciate your help.
Many thanks
Actually this didn't fix it... I just ended up with a column containing the expression as text e.g. "Num#(2)" - but I think that this may be data related rather than calcuations at fault...