Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have a created a simple listbox called Views by writing this expression :
=ValueList('a','b')
Basically, I want tp pass the selection to another field to do calculations. ie if a is selected then I should be able to refer to it from another expression by writing something like:
if(view = a, sum(sales), if(view = b, cost,null))
Any guidance would be more than appreciated.
Regards,
Aksel
Hi aetingu12
If I understand right, you want to change a field in your calculation based on a listbox selection (correct me if I am wrong).
You can achieve it in another way. Use a inline load with selections you want to do as follows:
1.
CalcSwitch:
Load * inline
[
%ColLabel,%ColName
'a','sum(sales)'
'b','cost'
];
2. Use %ColLabel in a listbox. You will be using this to change your calculation selection.
3. In calculation use the following:
$(=%ColName)
This will change the calculation based on your selection as per what you mention in the inline table.
Regards
Rajiv.
Hi,
Check this link.
Missing Manual - ValueLoop() & ValueList()
Regards,
Kaushik Solanki
Valuelist() values are not fields and so they cannot be selected.
Hi aetingu12
If I understand right, you want to change a field in your calculation based on a listbox selection (correct me if I am wrong).
You can achieve it in another way. Use a inline load with selections you want to do as follows:
1.
CalcSwitch:
Load * inline
[
%ColLabel,%ColName
'a','sum(sales)'
'b','cost'
];
2. Use %ColLabel in a listbox. You will be using this to change your calculation selection.
3. In calculation use the following:
$(=%ColName)
This will change the calculation based on your selection as per what you mention in the inline table.
Regards
Rajiv.
Much appreciated. Exactly what I wanted to do! Thank you.
Hi Aksel ,
Value List can be used only to create synthetic dimension, But even if u want it to get it such way means. you can create a field from your Scriptside using match function.
=If(MATCH(Customer,'A-2-Z Solutions','Aadast'),'A',
If(MATCH(Customer,'A Superior System','A&R Partners'),'B','Other'))
Regards,
Hirish