Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, Please help me.
for example, I have a pie chart, there are (2) expressions, one is $(vPercentage), other is 1-$(vPercentage),
vPercentage = Count({$<[Is purchased]={'Yes'}, Month={'Jul'}>}customerID)/Count({$<Month={'Jul'}>}customerID)
How can I show the pie chart by default for July, and also able to choose other month(s) data to show accordingly? Thank you.
Your kind help is appreciated.
you can use a variable :
vMaxMonth= Max(Month)
vPercentage = Count({$<[Is purchased]={'Yes'}, Month={'$(vMaxMonth)'}>}customerID)/Count({$<Month={'$(vMaxMonth)'}>}customerID)
Now you can select your month as max month.
Also if you want default month you can use Sheet Event Trigger where you can put a month as max month
Sheet Event Trigger
Sheet Properties -> Triggers -> OnActive Sheet -> Add Action -> External -> Set Variable ->
Variable=vMaxMonth
Value = Jul
One way could be putting a condition - when nothing is selected show 'Jul' data else as per selection. try like:
vPercentage = If( GetSelectedCount(Month), Count({$<[Is purchased]={'Yes'}>}customerID)/Count(customerID),
Count({$<[Is purchased]={'Yes'}, Month={'Jul'}>}customerID)/Count({$<Month={'Jul'}>}customerID)
)
Edit: corrected a bracket
you can use a variable :
vMaxMonth= Max(Month)
vPercentage = Count({$<[Is purchased]={'Yes'}, Month={'$(vMaxMonth)'}>}customerID)/Count({$<Month={'$(vMaxMonth)'}>}customerID)
Now you can select your month as max month.
Also if you want default month you can use Sheet Event Trigger where you can put a month as max month
Sheet Event Trigger
Sheet Properties -> Triggers -> OnActive Sheet -> Add Action -> External -> Set Variable ->
Variable=vMaxMonth
Value = Jul
Is Jul your max month? May be you can use Month(Date#(Max(Month))) instead of hard coding the month
Count({$<[Is purchased] = {'Yes'}, Month = {"$(=Month(Date#(Max(Month), 'M')))"}>} customerID)/Count({$<Month ={"$(=Month(Date#(Max(Month), 'M')))"}>} customerID)
Thank you all for all reply!