Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am looking for the QlikView_equivalent of the "mode" we learnt about in school, that is, the pos. value of an expression the result of which can be pos. or neg.
=> Ex.: I have an expression that can result in +4 or -4 - the mode in both cases would be +4 and since my target is "<5", that would be good.
Right now, I do it in a way that is just a little longer, checking whether the output is pos. or neg. and multiplying it with (-1) in case it is neg.
Thanks a lot!
Best regards,
DataNibbler
fabs ?
Did you try the mode function?
Returns the mode value, i.e. the most commonly occurring value, of expression over a number of records, as defined by a group by clause. If more than one value is equally commonly occurring, NULL is returned. Mode can return numeric values as well as text values.
Examples:
Load Month, mode( ErrorNumber ) as MostCommonErrorNumber from abc.csv group by Month;
Load Month, mode( Product ) as ProductMostOftenSold from abc.csv group by Month;
If you want a positive result always just do abs(mode(expression)
Great!
That saves me the trouble of writing the whole expression three times - and by that way it also saves on resources by the factor of 3, m.o.l...
Thanks a lot!
Best regards,
DataNibbler