Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have the graph below and I was just wondering how I would write the script to see if any of these data points/values for each month are greater than 8?
I have tried:
If(aggr(count(frequency), date) > 8, 'True', 'False')
which does not work.
(The blue line should return false as no point along it are greater than 8 and the red should return true)
Any help would be greatly appreciated.
Hi @JJ141
Try with Month, instead of date
If(aggr(count(frequency), Month) > 8, 'True', 'False')
Hope it helps
Hi @MayilVahanan thanks for the suggestion but unfortunately it didn't work.
The I have used data.autoCalendar.YearMonth as the x axis as the date is in dd/mm/yy format and it shows two groups.
Therefore I tried the following code you provided as well as:
If(aggr(Count(Frequency), date.autoCalendar.YearMonth, Group) > 8, 'True', 'False')
Which unfortunately also did not work.
Thanks
Hi @JJ141 , you can create a solution in the script, this is an example :
A:
Load
fields...,
frequency
from yoursource ;
B:
Load
MonthYear,
count(frequency) as FrecuencyCount
from A
group by MonthYear;
C:
Load
MonthYear,
if(FrecuencyCount>8, 'Greater', 'Lower') as Status
from B;
Then you can create your chart using MonthYear and Status as dimensions, and sum(FrecuencyCount) as expression.