Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Ive been trying to figure out how to write an expression to only display certain data in a chart, without having to select that option from a list box.
Lets say I have workorder table and there are 2 work types: EM and PM.
I want the chart to only show a count of EM ones, without having to select EM from a list box anywhere.
Ive tried to use an If: If(Worktype='EM',sum(Workordercounter)), but it didn't work.
I also tried to use some form of where clause: sum(Workordercounter) where Worktype='EM', but this didn't work.
Thanks
Hello Daniel,
Try this as expression
Sum({< Worktype = {'EM'} >} Workordercounter)
Hope that helps
EDIT: Your if conditional seems to be ok, but take into account that field names in QlikView are case sensitive, so Worktype is not equal to WorkType.
Hello Daniel,
Try this as expression
Sum({< Worktype = {'EM'} >} Workordercounter)
Hope that helps
EDIT: Your if conditional seems to be ok, but take into account that field names in QlikView are case sensitive, so Worktype is not equal to WorkType.
Works great thanks.
For future information - what is the syntax theory behind the {} curly brackets and <> brackets.
Thanks
It's called Set Analysis.
Take a look in the QlikView help section, here the syntax is explained in details. There are also a lot of topics in the forum discussing this feature, as it is quite powerful.