Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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
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 [
Hi Manoj,
could you please provide sample data for field [product_ref ]
=concat(‘”‘ & Product_ref & ‘”‘, ‘,’)) will return "product_ref",
by using concat we can make relation ship right?
pls explain me above expression how it works ?
Hi pfa
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)
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
Concate function return aggregate string
=concat(‘”‘ & Product_ref & ‘”‘, ‘,’))
Product_ref have values A and B
then it will retun "A","B"
what is the use of '"'& symbols here in the expresson
To get Value like this
'AB200'
You can replace that with chr(39)
Regards
ASHFAQ