Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ayumi37
Contributor
Contributor

Need help with a variant (?

Hi, i'm New at Qlikview, and i'm trying to simplify my code but i can't do it.For example this is my code when I load information from an excel source.

Load
Period,
[Company Code] as [CC],
Amount,
Amount * -1 as [Negative Amount],
[Negative Amount] /1000 as [Neg Amount in miles]

The code write with Bold, doesn't work, probably because "[Negative Amount]" it's not recognized from the source of the excel. But I need it to work, cause i'm on more complex formulas, and I need them to look easy to understand.

Pleasee help,

Labels (1)
  • Other

2 Solutions

Accepted Solutions
PrashantSangle

Hello,

 

You can not use newly created field in same load. Either you have to use full field logic again or use preceding load.

For example

1: using same logic for new field again

Load
Period,
[Company Code] as [CC],
Amount,
Amount * -1 as [Negative Amount],
(-1* Amount) /1000 as [Neg Amount in miles]

 

or using preceding load

Load *, [Negative Amount] /1000 as [Neg Amount in miles];

Load
Period,
[Company Code] as [CC],
Amount,
Amount * -1 as [Negative Amount] from table;

 

Regards,

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

Albert_Candelario

Hello @ayumi37 ,

@PrashantSangle  provided a very good comment and you kind find more information on the preceding load here:

Preceding LOAD ‒ QlikView

Cheers,

Albert

Please, remember to mark the thread as solved once getting the correct answer

View solution in original post

2 Replies
PrashantSangle

Hello,

 

You can not use newly created field in same load. Either you have to use full field logic again or use preceding load.

For example

1: using same logic for new field again

Load
Period,
[Company Code] as [CC],
Amount,
Amount * -1 as [Negative Amount],
(-1* Amount) /1000 as [Neg Amount in miles]

 

or using preceding load

Load *, [Negative Amount] /1000 as [Neg Amount in miles];

Load
Period,
[Company Code] as [CC],
Amount,
Amount * -1 as [Negative Amount] from table;

 

Regards,

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Albert_Candelario

Hello @ayumi37 ,

@PrashantSangle  provided a very good comment and you kind find more information on the preceding load here:

Preceding LOAD ‒ QlikView

Cheers,

Albert

Please, remember to mark the thread as solved once getting the correct answer