Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

difference of 2 expressions

1) Sum( {$<Year = (Year + {“20*”,1997}) – {2000} >} Sales )

2) Sum( {$<Year = Year + ({“20*”,1997} – {2000}) >} Sales )

What is the difference between 1 and 2?

14 Replies
kumarkp412
Creator II
Creator II

Hi

In the first expression

First, it will add the current year to 20 series years plus 1997 and then it will subtract it will 2000 ,then based on the resultant value of year it will calculate the sum of sales.

In the second expression

First, it will do the subtraction of 20series plus 1997 to 2000 , then resultant value is added to the current year and based on the final year  value it will calculate the sum of sales.

Thanks

Kumar

Frank_Hartmann
Master II
Master II

sum( {$<Year = Year + ({“20*”,1997} – {2000}) >} Sales )
returns the sales for the current selection but with additional selections in the field “Year”: 1997 and all that begin with “20” – however, not 2000. Note that if 2000 is included in the current selection, it will still be included after the modification.

sum( {$<Year = (Year + {“20*”,1997}) – {2000} >} Sales )
returns almost the same as above, but here 2000 will be excluded, also if it initially is included in the current selection. The example shows the importance of sometimes using brackets to define an order of precedence.

arethaking
Creator II
Creator II
Author

Will both give same results?

Frank_Hartmann
Master II
Master II

no, in the second example the 2000 is excluded whereas in example 1 it is included!

Anil_Babu_Samineni

1) Sum( {$<Year = (Year + {“20*”,1997}) – {2000} >} Sales )

* Means What ever value after 20-- from Year field

2000 --- 2016 and 1997 and then remove the 2000 Data from Year Field the value of Sales

2) Sum( {$<Year = Year + ({“20*”,1997} – {2000}) >} Sales )

Still Confusing here. Need more analysis about this

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Are these expression even working? I have a strange feeling that both of them might not be working, but I may be wrong.

Frank_Hartmann
Master II
Master II

But they are described in the QV help, so they should work 🙂

sunny_talwar

Oh really? Would you be able to guide me to location of these expressions. I would love to understand the syntax

Frank_Hartmann
Master II
Master II

search for : {set_identifier<set_modifier>}

in QV help. There is only one hit. you will find the expressions within that page 🙂