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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
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.

Labels (1)
20 Replies
pgalvezt
Specialist
Specialist
Author

They are tries in the past. Now I tried to use just DiasMora. But QlikView Drops an aggregation problem.

pgalvezt
Specialist
Specialist
Author

Sure, The principal bases contains dates (DiasMora = Debtdate - EndMotnh) So If 20/07/2012 - 31/07/2012 = 11 Days.

So

If(DiasMora = 41060, Dual('Al Día',1), // 41060 its a wired date but means no debt

If(DiasMora >= 1 And DiasMora <=30, Dual('1-30 Días',2))) as Estratificacion // Here would go 20/07/2012-31/07/2012 = 11 Days.

In the final Table my dimmension it would be Estratificacion and my Expression Sum(Deuda_Total)

The final table Would be

estratificacion    DeudaTotal

Al Dia                    356000

1-30                      875441

31-60                    554545

and so on.

MayilVahanan

Hi

     You can use like this,

    

          I think , this is one of the way to achieve your requirement..

     Load if(DiasMora >= [minimumvalue of datefield]+1 and DiasMora <= [minimumvalue of datefield]+30, Dual('1-30  Días',2))

[minimumvalue of datefield] for example, in textbox give expression like this, Num(min(DateField))

Like wise you can get the value..

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

Im Sorry I didn't Understand the datafield value. Could You please put an example?

Thank you.

MayilVahanan

Hi

DiasMora = 41060. is this dateField?

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

is endmonth by databases. for example 41060 = 31/05/2012 Because de databases is for all may. and so on.

Look the jpg example.

MayilVahanan

Hi

     Ok..Do you know the starting date of your database? You can use like this, MonthStart(Lowest date in your database)

for example 41060 = 31/05/2012

but starting date? MonthStart(date(41060) ) gives 01/05/2012

Like this, which is the starting date? Something like 01/01/2010

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

I dont have Starting date I have just PeriodoMora(This field) PeriodoMora-EndMonth (41060)= Nº DaysMora (DebtDays)

PeriodoMora-EndMonth (41060) = 41060 means the client desn't have debt. So he is at day.

If debtdays for example is 50 I have to put in > 31 and < 60 and so on. After that I have to build the table with all differents days debt and thouse stratifications for month. because the databases is in Visual Fox pro extension dbf Im creating may.

MayilVahanan

Hi

     Then you simply use,

     if(DebtDays > 31 and DebtDays < 60, '31-60 days') like that

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

Doesn't Work

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

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

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

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

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

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

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

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

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

Look Happen some rare When reload the QlikView Al dia = 1651913 (Toooo High)

But when I put in my Expression This:

=Sum({<DiasMora={'41060'}>}Deuda_Total)

QlikView bring me the real value 327347 (The same value that in Excel File). But I dont want the hiugh formula in my expression because QlikView its getting too slow.

Please look up the jpg file.