Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team
I'm trying to use Pick Function as below.
My Variable is vPostService. It has values as either 1 or 2
Post Date and Service Date are my dimensions.
avg(aggr(sum(Sales), Pick(vPostService,PostDate,ServiceDate)))
Appreciate the help
Tried vPostService as $(vPostService) and no luck
@satishkurra or with below pick in reference line expression
pick(vPostService,
avg(total aggr(sum(Sales), [Post Date])) + 3*stdev(total aggr(sum(Sales), [Post Date]),
avg(total aggr(sum(Sales), [Service Date])) + 3*stdev(total aggr(sum(Sales), [Service Date])))
I see what you are trying to do. I have not seen this pattern before.
The issue here is that in your pick() expects an string input, not a field reference. Try this adjustment:
avg(aggr(sum(Sales), Pick($(vPostService),'PostDate','ServiceDate')))
Or this:
avg(aggr(sum(Sales), [$(=Pick($(vPostService),'PostDate','ServiceDate'))] ))
Hi @Vegar
Tried both options and no luck
@satishkurra try like below
=pick(vPostService,
avg(aggr(sum(Sales), [Post Date])),
avg(aggr(sum(Sales), [Service Date])))
Hi @Kushal_Chawda , Tried and no luck
@satishkurra can you send screenshot of your expression? In which chart you are using this expression? Make sure that variable always holds any values if it has null value expression will not work.
Sure.
Dimension: =pick(vPostService,[Post Date],[Service Date])
Expression: Sum(Sales)
Reference Line: avg(aggr(sum(Sales), [Post Date])) + 3*stdev(aggr(sum(Sales), [Post Date]))
For Reference Line expression, I'm trying to Switch with a button to change the dimension between Post Date and Service Date like I entered in the Dimension. It is displaying the chart but the reference line is not showing up.
Please let me know if this info helps
@satishkurra try below in reference line
avg(total aggr(sum(Sales), [Post Date])) + 3*stdev(total aggr(sum(Sales), [Post Date]))
@satishkurra or with below pick in reference line expression
pick(vPostService,
avg(total aggr(sum(Sales), [Post Date])) + 3*stdev(total aggr(sum(Sales), [Post Date]),
avg(total aggr(sum(Sales), [Service Date])) + 3*stdev(total aggr(sum(Sales), [Service Date])))
This worked. Thanks a ton @Kushal_Chawda