Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 4 different rates that I want to multiply against depending on a location. Here is my example
column1 is
atlanta
chicago
cleveland
Miami
column 2 cost
cost
column 3 rate
4
5
2
6
So atlanta needs to be cost * 4
chicago needs to be cost * 5
etc.
any thoughts?
If its in a same script table, then may be like this -
pick(match(Location, 'atlanta','chicago','cleveland','Miami'),
cost*4, cost*5, cost*2,cost*6) as value;
Thanks it’s just a table chart right now.
Not sure but if all the fields are in the same table or properly associated, this should work I think in table chart as well..
Example code.
Location:
Load * Inline [
location, cost, rate
atlanta, 1000
chicago,2000
cleveland,345
Miami,5667
];
LocationCost:
load
location,
pick(match(location,'atlanta','chicago','cleveland','Miami'),cost*4,cost*5,cost*2,cost*6) as locationcost,
if(location='atlanta',4,(if(location='chicago', 5,if(location='cleveland',2,if(location='Miami',6))))) as rate
Resident Location;
Thanks-- didnt work though.
Pl share your table chart, expected output etc Its difficult to identify problem without knowing what and where you are trying the shared expression
@jham55 please find from the attached qvf.