Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
pascos88
Creator II
Creator II

Use of field in set expression

Hi Guys, I need to use a return of field in set expression:

if(GetFieldSelections(Chiave) = 'fin',sum( {$<Chiave={$('usare1')}>} Costi ),0)

where usare1' is a field of the table...

How I can do it?

Any suggestions?



Thanks

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

maybe this:

=if(GetFieldSelections(Chiave) = 'fin',sum( {< Chiave = P(usare1) >} Costi ) ,0)

I hope this helps.

View solution in original post

6 Replies
agigliotti
Partner - Champion
Partner - Champion

where are you using that expression?

sohb2015
Contributor III
Contributor III

Hi,

Can you elaborate a little.

What field are you selecting, and what you want to achieve.

niclaz79
Partner - Creator III
Partner - Creator III

If usare1 is a dimension, try the following in your set-expression:


Chiave= P(usare1)

pascos88
Creator II
Creator II
Author

Sum.PNG

usare1 is a dimension in another table. so when I select 'fin' in tbl 1, the sum should return to me the sum of all values in the tbl1 with Chiave of tbl1 = to usare1 of tbl 2.

in this case, I select fin, since usare1 in the tbl 2 is 1, the sum should return 93

if(GetFieldSelections(Chiave) = 'fin',sum( {$<Chiave=P(usare1)>} Costi ),0)..

I need maybe to use the dimension in the expression in a differnet way...

agigliotti
Partner - Champion
Partner - Champion

maybe this:

=if(GetFieldSelections(Chiave) = 'fin',sum( {< Chiave = P(usare1) >} Costi ) ,0)

I hope this helps.

sohb2015
Contributor III
Contributor III

Hi,

=if(GetFieldSelections(Chaive)='fin',sum({<Chaive=p(user1)>}Cost),0) seems to work fine.

when you select fin, it returns 93, otherwise 0.

However, in what type of chart you wish to apply this and what is the business case behind this?