Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

chkelley
New Contributor III

Counting the output from stdev

Ok, I have a data set that includes a host of temperature values (captured over time every minute or so). I am displaying a table that includes the name of the sensor, the temperature value, and then the stdev of these measures over time.

Now, I want to display a count of the number of instances where stdev=0 - in essence, the number of devices always reporting the exact same temperature all the time.

I would have expect the following to work:

count(stdev(thermal_temp_c)=0)

However, nested aggregation is not allowed.

Anyone have a thought on another way of doing this?

Tags (3)
4 Replies

Re: Counting the output from stdev

You could try something like: count({<Instance={"=stdev(thermal_temp_c)=0"}>)Instance)

chkelley
New Contributor III

Re: Counting the output from stdev

Ok, progress - had to play around with it a bit, and the below works to the extent that there are no more syntax errors:

count ({<thermal_temp_c_stdev_instance={"=stdev(thermal_temp_c)=0"}>}thermal_temp_c_stdev_instance)

Only issue is that it throws a "bad field name thermal_temp_c_stdev_instance" error - which implies that thermal_temp_c_stdev_instance is not actually set. Is Sense expecting that thermal_temp_c_stdev_instance be declared explicitly as a field name prior?

Re: Counting the output from stdev

Yes, you can only use field names. Calculated dimensions and measure names won't work.

chkelley
New Contributor III

Re: Counting the output from stdev

Good catch, added the following to the data loader:

SET thermal_temp_c_stdev_instance = '';

Only issue is now I only see a result of "1". Odd.