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: 
renuka_sasikumar
Creator III
Creator III

Multiplication with Multiple fields in load Script.

Hi,

Table ATable B
AccCodeAccCode
ComputaionAB_History_AB_consumed,
AccOpnAB_DEL,
AB_ID,
AB_Fut,
AB_Opt,
AB_History_AB_CDS,
AB_CDS_OPT,
AB_Excess
xyz
abc

I have joined Table A & B

Now I want the Fields

eg: AB_DEL,

AB_ID

...

....

to multiply by computation

Can you help me with syntax to get this output

Thanks & Regards,

Renuka S

1 Solution

Accepted Solutions
renuka_sasikumar
Creator III
Creator III
Author

Hi,

Can I write like this

AB_DEL as AB_DEL_OR,

     if(AB_DEL>0, Num(AB_DEL)*Num(Computation)) as AB_DEL,

     AB_ID as AB_ID_OR,

     if(AB_ID>0, Num(AB_ID)*Num(Computation)) as AB_ID,

Is this a correct a way...Can I use it.

Thanks & Regards,

Renuka S

View solution in original post

9 Replies
sunny_talwar

Now I want the Fields

eg: AB_DEL,

AB_ID

...

....

to multiply by computation

What do you mean by the last line above, are you trying to get AB_DEL * computation and AB_ID * computation???

renuka_sasikumar
Creator III
Creator III
Author

Yes I want the same to be done

sunny_talwar

Have you tried this:

TableA:

LOAD AccCode,

          Computaion,

          AccOpn,

          AB_ID,

          AB_Fut,

          AB_Opt,

          AB_History_AB_CDS,

          AB_CDS_OPT,

          AB_Excess,

          xyz,

          abc

FROM Source1;


Join (TableA)

LOAD AccCode,

          AB_History_AB_consumed,

          AB_DEL

FROM Source2;


FinalTable:

LOAD *,

          AB_DEL * Computation as NewField1,

          AB_ID * Computation as NewField2,

          ...

Resident TableA;

DROP Table TableA;

renuka_sasikumar
Creator III
Creator III
Author

Hi,

Can I write like this

AB_DEL as AB_DEL_OR,

     if(AB_DEL>0, Num(AB_DEL)*Num(Computation)) as AB_DEL,

     AB_ID as AB_ID_OR,

     if(AB_ID>0, Num(AB_ID)*Num(Computation)) as AB_ID,

Is this a correct a way...Can I use it.

Thanks & Regards,

Renuka S

giakoum
Partner - Master II
Partner - Master II

load

AB_DEL * computation as ABDelMultiplied,

AB_ID * computation as ABIDMultiplied

....

resident yourTable


etc.


Is this what you are asking?

giakoum
Partner - Master II
Partner - Master II

try it

but note that num is a format function. If you need to change the field type, use Num#

sunny_talwar

Absolutely, I don't see anything wrong with what you just showed. Do you get any error when you run it?

renuka_sasikumar
Creator III
Creator III
Author

No I am not getting any error.

I think its working.

But hope there should be no problem in rest of Data.

Thank you everyone for your prompt reply.

Thanks & Regards,

Renuka S

sunny_talwar

Yup, you can always come back when you see discrepancies in the results you are seeing.

Best,

Sunny