Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
michael_andrews
Partner - Creator
Partner - Creator

Equivalent to Variance Function?

I'm wondering if there is some sort of equivalent to the variance sql function? I.e., a way for me to get 1.66 from this data as you would if you ran this sql

CREATE TABLE #foo(f_val int)

INSERT INTO #foo VALUES(1), (2), (3), (4)

SELECT var(f_val) FROM #foo

15 Replies
swuehl
MVP
MVP

You can define a variable (not in the expression window, but either in the script or in the variable overview in the UI).

For example, add to your script:

SET vCount = Count(ItemMeasure)/Count(ExamMeasure);

Then you can use the variable in your chart expressions:

=($(vCount)) / ($(vCount) - 1)

The Magic of Variables

The Magic of Dollar Expansions

To get you up and started, I would recommend that you go through some free tutorials that Qlik offers

New to Qlik Sense

or since most of the language is shared with QlikView

QlikView 11 Developer Tutorial

Or grab a good book

Books and literature

Have fun!

michael_andrews
Partner - Creator
Partner - Creator
Author

Is the variable in the UI an extension? I vaguely remember reading something about that.

swuehl
MVP
MVP

No, I don't think so.

If you want to modify the variable in the UI as a user (accessing the app in the accesspoint), you need(ed?) an extension.

michael_andrews
Partner - Creator
Partner - Creator
Author

This is the only variable thing I've ever known of, and we had to install it as an extension. http://i.imgur.com/Asjc2yl.png

swuehl
MVP
MVP

Enter edit mode of your app, then you can find the variable overview:

2017-01-24 23_33_29-.png

michael_andrews
Partner - Creator
Partner - Creator
Author

Great, I'll check that out tomorrow. Thanks again for all your help!