Aldo wrote:I successfully created some variables, but I can not create variables where I need to calculate Sums, etc
You can assign expressions to variables like:
SET FinalAmount = sum((UnitPrice-Discount) * Quantity);
and then use the expression in a chart as:
Is that what you are after?
Aldo wrote: I also want to know if there is any statement (in qlikview script) to be used like "Switch" or "Select Case" instead of dealing with a lot of "Ifs".
QV Script provides a Switch Case statement. It's a control statement, so it cannot be used in a LOAD statement, which may be what you are looking for. There are alternatives to nested if(), such as mapping or the match() function. If you can post some specific examples of what you are dealing with, perhaps we can provide some suggestions.
If expression or field iterated over the chart dimension(s) contain one single value, that value is returned, else NULL is returned. Only can return numeric values as well as text values.
I try Anatoly's approach, but something is missing.
Please take a look at the attachment.
Actually, I need to make the Table showing the sales by Db or Company or Division.
Rob, I am using your suggestions.
Thanks in advance for any help.
Thanks a lot!
Could you help me fixing the SET statement (in script) for variable "vdbOrCompOrDiv" in order to make Table2 working?
Take a look in the attached file.