Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

Can someone please correct my expression?

Hi all,

my table looks like this:

Raised_Month, Attendance_Time, Fault_Code, Equipment_Type

I want one chart with Equipment Type as the dimension and 2 counts as the expressions.

one is for total faults (count any) and one is for site attendances.

the problem is that if I filter raised month to June for example the attendance count counts the attendances of faults that occurred in June NOT the attendances that occur in June.

there im trying the below but cant get the syntax correct. what its supposed to do is;

irrespective of any filter (i.e ignore the raised month filter) count the amount of attendances where the month(Attendance_Time) equals the raised month. so If I filter to June on Raised month it counts the attendances in June.

=count({1< Attendance_Time = {'>0'}, month(Attendance_Time) = {$(Raised_Month)} >}Fault_Code)

thanks

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

You can't use an expression on the LHS of a set expression. I assume that Attendance_Time is a date time value, so create and Attendance_Month field in the load script, then use:

=count({<Attendance_Month = {$(=Max(Raised_Month))}>} Fault_Code)

This assumes that you are making the selection on Raised_Month and this field is a normal QV month field (dual)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi,

Bring Attendance Month field in script and use it in the Set analysis expression

LOAD
*,

Month(Attendance_Time ) AS Attendance_Month

FROM DataSource;

Now use this expression

=count({<Attendance_Month = {$(=Max(Raised_Month))}>} Fault_Code)


Note Raised_Month and Attendance_Month should be in the same format.


Hope this helps you.


Regards,

Jagan.