Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

paulyeo11
Valued Contributor II

How to combine 2 load script into 1 for compute total asset ?

Hi All

I have below 2 load script working fine :-

If([Reporting Code]>=50010 and [Reporting Code]<=50090,'cURR_ASSET') as [cURR_ASSET],

If([Reporting Code]>=20005 and [Reporting Code]<=20063,'fIXED_ASSET') as [fIXED_ASSET],

I try to combine the above 2 into 1 load script , i try below :-

If([Reporting Code]>=50010 and [Reporting Code]<=50090,'cURR_ASSET',

If([Reporting Code]>=20005 and [Reporting Code]<=20063,'fIXED_ASSET',

))as [tOTAL_ASSET]

it return wrong value. Can some one advise me ?

it should be look some thing like below :-

If([Reporting Code]>=50010 and [Reporting Code]<=50090) & ([Reporting Code]>=20005 and [Reporting Code]<=20063,'tOTAL_ASSET') as [tOTAL_ASSET],

Paul

1 Solution

Accepted Solutions

Re: How to combine 2 load script into 1 for compute total asset ?

Hi Paul,

May be something like this..

If(  ([Reporting Code]>=50010 and [Reporting Code]<=50090) or 
(
[Reporting Code]>=20005 and [Reporting Code]<=20063),
'tOTAL_ASSET')
as [tOTAL_ASSET]


OR

if you want the fIXED ASSET and cURR ASSET value in your tOTAL ASSET field, try something like..


If([Reporting Code]>=50010 and [Reporting Code]<=50090,'cURR_ASSET',
If([Reporting Code]>=20005 and [Reporting Code]<=20063,'fIXED_ASSET'))as [tOTAL_ASSET]

4 Replies

Re: How to combine 2 load script into 1 for compute total asset ?

Hi Paul,

May be something like this..

If(  ([Reporting Code]>=50010 and [Reporting Code]<=50090) or 
(
[Reporting Code]>=20005 and [Reporting Code]<=20063),
'tOTAL_ASSET')
as [tOTAL_ASSET]


OR

if you want the fIXED ASSET and cURR ASSET value in your tOTAL ASSET field, try something like..


If([Reporting Code]>=50010 and [Reporting Code]<=50090,'cURR_ASSET',
If([Reporting Code]>=20005 and [Reporting Code]<=20063,'fIXED_ASSET'))as [tOTAL_ASSET]

paulyeo11
Valued Contributor II

Re: How to combine 2 load script into 1 for compute total asset ?

Hi Settu

Many thank it work fine.

Paul

paulyeo11
Valued Contributor II

Re: How to combine 2 load script into 1 for compute total asset ?

Hi Settu

this is one of the script you give me :-

If([Reporting Code]>=50010 and [Reporting Code]<=50090,'cURR_ASSET',
If([Reporting Code]>=20005 and [Reporting Code]<=20063,'fIXED_ASSET'))as

[tOTAL_ASSET]


I am getting null value.


Paul

Re: How to combine 2 load script into 1 for compute total asset ?

Hi Paul,

Can you check the 'Report Code' value is available (between 50010 and 50090) ? and is that created the new field 'tOTAL ASSET' ?