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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Expression Works But not in the script.

Hello, I have this expression: =Sum({<DebtDays={'123456'}>}TotalDebt) Works Fine:

But in the script I put:

Est:
Load Num_Card_OP,

If(Sum(DebtDays= 123456),TotalDebt) as Estratificacion
 
resident table1
Group By Num_Card_OP;

Thanks.

20 Replies
MayilVahanan

Hi

Try like this,

Load Num_Card_OP,

If(DebtDays= '123456',Sum(TotalDebt)) as Estratificacion 
resident table1

Groupby

TotalDebt , Num_Card_OP;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
pgalvezt
Specialist
Specialist
Author

Thanks for your reply: Works but drop many values with my expression I get just one total. Miss something?

MayilVahanan

HI

     Its calculate the value for DebtDays= '123456'.. and take value(TotalDebt) for that.What is your requirement

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable

You can also flag records (in the script) that have DebtDays = '123456' and then use the flag in your set analysis. that way you'll have both DebtDays and non-DebtDays values.

pgalvezt
Specialist
Specialist
Author

The requirement is get phases for debt days (Debt Days = DateDebt - endMonth).So

If debt days = 123456 1-30 days,

If debt days =123456789 31-60 and so on. I left a QlikView file for better comprehenssion. Finally I have to build a table with Stratos by Total debt for sectors.

pgalvezt
Specialist
Specialist
Author

Any Help please

Thanks.

pgalvezt
Specialist
Specialist
Author

Could you please put an example?

pgalvezt
Specialist
Specialist
Author

I tried:

 

If

(DiasMora = 41060, Dual('Al Día',1),
If(DiasMora >= 1 And DiasMora <=30, Dual('1-30 Días',2))) as Estratificacion

But QlikView drop a Aggregation Problem.

MayilVahanan

HI

     in this,

Estratificacion:

Load Num_Tarjeta_OP,

if(DiasMora = 41060, sum(Deuda_Total)) as Estratificacion

//If(DiasMora = 41060, Dual('Al Día',1)) as Estratificacion

/*if(sum(DiasMora)>=1   And  sum(DiasMora)<=30,  Dual('1-30  Días',2),

if(sum(DiasMora)>=31  And  sum(DiasMora)<=60, Dual('31-60 Días',3),

if(sum(DiasMora)>=61  And  sum(DiasMora)<=90,Dual('61-90 Días',4),

if(sum(DiasMora)>=91  And  sum(DiasMora)<=120,Dual('91-120 Días',5),

if(sum(DiasMora)>=121  And  sum(DiasMora)<=150, Dual('121-150 Días',6),

if(sum(DiasMora)>=151  And  sum(DiasMora)<=180, Dual('151-180 Días',7),

if(sum(DiasMora)>=181  And  sum(DiasMora)<=210,Dual('181-210 Días',8),

if(sum(DiasMora)>=211  And  sum(DiasMora)<41029, Dual('>211 Días',9)))))))))) as Estratificacion*/          

resident Cartera

Group By Deuda_Total,Num_Tarjeta_OP;

sum(DiasMora) value?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.