Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

explination?

sum({$<PRODUCT ={$(=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))}>} SALES) 

here i have product  and  product_ref  separate fields

product belonges to t1 table and    product_ref  belonges to  table t2.

to make relationship  between tl and t2 they have been used concat function   thats ok fine    but here

=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))          what is use of this symbols '"' &product_ref &'"',','     pls give me explination about this

if i am selecting one product then next how it works?

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi,

Replace your expression with below

=sum({$<PRODUCT ={$(=concat(chr(39)&Product_ref&chr(39),','))}>} SALES) 

It will let you select multiple entries/selections too.

Regards

ASHFAQ

View solution in original post

10 Replies
anbu1984
Master III
Master III

If two tables are not linked, then selecting on Product wont affect the sum. Check the attached qvw.

Try uncomment this line and reload and check the results

//Load *,Product_ref as PRODUCT Inline [

Not applicable
Author

Hi Manoj,

could you please provide sample data for field [product_ref ]

=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))  will return "product_ref",

Not applicable
Author

by using concat we can make relation ship right?

pls explain me above expression how it works ?

Not applicable
Author

Hi pfa

anbu1984
Master III
Master III

Relationship or links between tables can be made at script level.

sum({$<PRODUCT ={$(=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))}>} SALES) is equivalent to sum({$<PRODUCT ={'a','b'}>} SALES).Instead of hard coding values, you are getting from a field(Product_ref)

ashfaq_haseeb
Champion III
Champion III

Hi,

Its a kind of indirect set Analysis.

The code

=concat(‘”‘ & Product_ref & ‘”‘, ‘,’) will give you o/p  ex: as 'AB200'

And hence you get sum for that particular Reference.

If you have any single selection in field Product_ref

Then your set expression is converted like this

=sum({$<PRODUCT ={AB200}>} SALES) 

Hope it helps

Regards

ASHFAQ

Not applicable
Author

Concate function  return aggregate string

=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))

Product_ref  have values  A and B

then it will retun "A","B"

Not applicable
Author

what is the use of   '"'&  symbols here in the expresson

ashfaq_haseeb
Champion III
Champion III

To get Value like this

'AB200'


You can replace that with chr(39)


Regards

ASHFAQ