Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How works Variable overview

Hi all,

Who can help me with variable overview?

I have many calculation in one expression. I want to change them by variables, like

v1=Sqr(Stdev({<={'aaa'}, ={'bbb'}>}))

then use them in expression:

([1st Time]-after([1st Time]))/SQRT(((N+after(N))/(N*after(N)))*(v1*(N-1)+after(v1)*(after(N)-1))/(N+after(N)-2))

Thanks for your help,

1 Solution

Accepted Solutions
IAMDV
Luminary Alumni
Luminary Alumni

You can use the dollar sign expansion. you need something like this...

([1st Time]-after([1st Time]))/SQRT(((N+after(N))/(N*after(N)))*($(v1)*(N-1)+after($(v1))*(after(N)-1))/(N+after(N)-2))

Cheers - DV

www.QlikShare.com

View solution in original post

15 Replies
IAMDV
Luminary Alumni
Luminary Alumni

You can use the dollar sign expansion. you need something like this...

([1st Time]-after([1st Time]))/SQRT(((N+after(N))/(N*after(N)))*($(v1)*(N-1)+after($(v1))*(after(N)-1))/(N+after(N)-2))

Cheers - DV

www.QlikShare.com

Anonymous
Not applicable
Author

Thanks!!! It works!!!!

So when I used expression which I need to calculate, I should use $.

Thanks a lot.

IAMDV
Luminary Alumni
Luminary Alumni

Great. Yes, I follow a standard practice of storing my expressions in the variables. This way we can use the variables as Abstract layer and it also helps to manage the expressions in centralised environment. I'm attaching a pdf document for your reference. Please check the Dollar Sign Expansion page in the pdf file.

I hope this helps!

Cheers - DV

www.QlikShare.com

Anonymous
Not applicable
Author

Thank for the pdf document.

How to simplify the expression:

v1=Sqr(Stdev({<={'aaa'}, ={'bbb'}>}))

I have many variables like this, but changed only variable

Regards,

Anonymous
Not applicable
Author

I have variables

v1=Sqr(Stdev({<={'aaa'}>}))

v2=Count({<={'aaa'}>})

How can I add condition B='bbb' to this expression?

([1st Time]-after([1st Time]))/SQRT((($(v2)+after($(v2)))/($(v2)*after($(v2))))*($(v1)*(N-1)+after($(v1))*(after($(v2))-1))/($(v2)+after($(v2))-2))

B='bbb' uses for v1 and v2.

Thanks in advance,


IAMDV
Luminary Alumni
Luminary Alumni

I think you need something like UDF (User Defined Functions). Please read this post and you will learn how to dynamically change your fields while keeping the same calculation methodology in the Variables.

Cheers,

DV

Anonymous
Not applicable
Author

I read the post. It's complicated for me.

I have different 10 tables.

v1=Sqr(Stdev({<={'aaa'}>}))

v2=Count({<={'aaa'}>})

I remove variable B from v1 and v2. In each of them changed variable B. Variable B is different in each table.

I confused you?

Cheers,

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Please can you post the sample QVW file? And also give me the list of values which will fit in field B? I'll build a UDF expression.

Regards,

DV

www.QlikShare.com

Anonymous
Not applicable
Author

Thanks for reply,

Please find attached file.

Thanks again,