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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
chandra63
Creator
Creator

variables creation

Hi All,

I want to create variables like this.

  • total_od_recovered_above_90

(Total recovered /total OD) percent is above 90

  • total_od_recovered_76_90

(Total recovered /total OD) percent is between 76 and 90

  • total_od_51_75

(Total od/payment tenure) percent is between 51 and 75

  • total_od_above_90

(Total od/payment tenure) percent is above 90

  • total_od_recovered_51_75

(Total recovered /total OD) percent is between 51 and 75

  • total_od_76_90

(Total od/payment tenure) percent is between 76 and 90

  • total_od_26_50

(Total od/payment tenure) percent is between 26 and 50

  • total_od_recovered_26_50

(Total recovered /total OD) percent is between 26 and 50

  • sales_vintage_1

Age of the customer lifecycle is 2

  • pay_tenure_12

Payment tenure is 12

  • pay_tenure_24

Payment tenure is 24

  • total_emi_rlz_26_50

Total (recovered + non od)/payment_tenure percent is between 26 and 50

  • total_emi_rlz_51_75

Total (recovered + non od)/payment_tenure percent is between 51 and 75

I need help in resolving this.

Please help me here.

Thanks.

2 Solutions

Accepted Solutions
Anil_Babu_Samineni

Perhaps this? Make sure, This can be used in Front end. If you want to use or calling in script as field then you need Aggregate which based on your Logic of Business.

  • LET total_od_recovered_above_90 = '=If(Sum(Recovered/OD)>Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_76_90 = '=If(Sum(Recovered/OD)>=Num(0.76)*100 and Sum(Recovered/OD)<=Num(0.9)*100, Sum(Recovered/OD))';

  • LET total_od_51_75 = '=If(Sum(OD/Tenure)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum(Recovered/OD))';

  • LET total_od_above_90 = '=If(Sum(OD/Tenure)>Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_51_75 = '=If(Sum(Recovered/OD)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum(Recovered/OD))';

  • LET total_od_76_90 = '=If(Sum(OD/Tenure)>Num(0.76)*100 and If(Sum(Recovered/OD)<Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_26_50 = '=If(Sum(OD/Tenure)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_26_50 = '=If(Sum(Recovered/OD)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum(Recovered/OD))';

  • LET sales_vintage_1 = '=If(Age(Customer, Today())=2,Age(Customer, Today()))';

  • LET pay_tenure_12 = '=If(Payment_Tenure=12,Payment_Tenure)';

  • LET pay_tenure_24 = '=If(Payment_Tenure=24,Payment_Tenure)';

  • LET total_emi_rlz_26_50 = '=If(Sum((Recovered+NONOD)/Payment_Tenure)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum((Recovered+NONOD)/Payment_Tenure))';

  • LET total_emi_rlz_51_75 = '=If(Sum((Recovered+NONOD)/Payment_Tenure)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum((Recovered+NONOD)/Payment_Tenure))';
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

chandra63
Creator
Creator
Author

Hi Anil,

it  works.

Thanks.its Helpful to me

Chandra

View solution in original post

12 Replies
tharanikannan
Contributor III
Contributor III

Hi ,

Please attach a sample qvw file. Creating variables are easy. But please mention your requirement clearly.

Anil_Babu_Samineni

Perhaps this? Make sure, This can be used in Front end. If you want to use or calling in script as field then you need Aggregate which based on your Logic of Business.

  • LET total_od_recovered_above_90 = '=If(Sum(Recovered/OD)>Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_76_90 = '=If(Sum(Recovered/OD)>=Num(0.76)*100 and Sum(Recovered/OD)<=Num(0.9)*100, Sum(Recovered/OD))';

  • LET total_od_51_75 = '=If(Sum(OD/Tenure)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum(Recovered/OD))';

  • LET total_od_above_90 = '=If(Sum(OD/Tenure)>Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_51_75 = '=If(Sum(Recovered/OD)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum(Recovered/OD))';

  • LET total_od_76_90 = '=If(Sum(OD/Tenure)>Num(0.76)*100 and If(Sum(Recovered/OD)<Num(0.90)*100, Sum(Recovered/OD))';

  • LET total_od_26_50 = '=If(Sum(OD/Tenure)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum(Recovered/OD))';

  • LET total_od_recovered_26_50 = '=If(Sum(Recovered/OD)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum(Recovered/OD))';

  • LET sales_vintage_1 = '=If(Age(Customer, Today())=2,Age(Customer, Today()))';

  • LET pay_tenure_12 = '=If(Payment_Tenure=12,Payment_Tenure)';

  • LET pay_tenure_24 = '=If(Payment_Tenure=24,Payment_Tenure)';

  • LET total_emi_rlz_26_50 = '=If(Sum((Recovered+NONOD)/Payment_Tenure)>Num(0.26)*100 and If(Sum(Recovered/OD)<Num(0.50)*100, Sum((Recovered+NONOD)/Payment_Tenure))';

  • LET total_emi_rlz_51_75 = '=If(Sum((Recovered+NONOD)/Payment_Tenure)>Num(0.51)*100 and If(Sum(Recovered/OD)<Num(0.75)*100, Sum((Recovered+NONOD)/Payment_Tenure))';
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jyothish8807
Master II
Master II

Hi Chandra,

You can do it by loading them in excel as well.

refer this:

Set Analysis in Expression (Chart)?

Br,

KC

Best Regards,
KC
chandra63
Creator
Creator
Author

Hi Anil,

Thanks,

First Variable is showing the value.

Rest of the things we are not getting Values

output:   '-' like this

please do needful

Thanks

Anil_Babu_Samineni

Try this in text object.

If(Sum(Recovered/OD)>=Num(0.76)*100 and Sum(Recovered/OD)<=Num(0.9)*100, Sum(Recovered/OD))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
chandra63
Creator
Creator
Author

HI Tharani,

help me on this.

Variables Creation &amp; Equation

please refer this.

Thanks & Regards.

Chandra

chandra63
Creator
Creator
Author

Hi Anil,

I have tried it. Still showing no value

Please help me.

Thanks.

Anil_Babu_Samineni

looks like, you don't have values between the condition? Would you like to share sample test?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
chandra63
Creator
Creator
Author

HI Anil,

help me on this.

Variables Creation & Equation

please refer this.

Thanks & Regards.

Chandra