Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable creation

Can I create a variable in order to be used afterwards in other formulas?

if((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22)<0,0,((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22))*Valor/100) as Variable

So I can use it then as

(Variable/22)*10) +sum([Total Time Spent]))/(sum(timeuser)*10)

instead of

(((if((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22)<0,0,((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22))*Valor/100)/22)*10)+sum([Total Time Spent]))/(sum(timeuser)*10)

Thanks!

1 Solution

Accepted Solutions
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Yes. it is possible.

Try adding your variable in Data Load Editor. like below.

SET vExp = if((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22)<0,0,((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22))*Valor/100);

And then reference this in your expression like below.

(($(vExp)/22)*10) +(sum([Total Time Spent]))/(sum(timeuser)*10)

Find attached for you reference.

View solution in original post

2 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Yes. it is possible.

Try adding your variable in Data Load Editor. like below.

SET vExp = if((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22)<0,0,((sum(timeuser)*22)-((sum([Total Time Spent])/10)*22))*Valor/100);

And then reference this in your expression like below.

(($(vExp)/22)*10) +(sum([Total Time Spent]))/(sum(timeuser)*10)

Find attached for you reference.

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Jose,

Can you mark this thread "Correct Answer"  if above solution solves your problem. That way other people can find this useful.