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: 
Not applicable

Creating a field in the script

We are trying to create a field name "PREMIUM" in our script using the following formula:

if (AmountType = 'P' , SignedAmount) as PREMIUM

When reloading the script there are no errors however when trying to load the field PREMIUM in a table or chart this field is not showing.

Any ideas?

Thanks.

5 Replies
tresesco
MVP
MVP

It looks fine, please check the data.

Vegar
MVP
MVP

Check if your logical statement is correct by adding two more columns.


LOAD

[whaterverfields your are using],

if (AmountType = 'P' , SignedAmount) as PREMIUM,

if (AmountType = 'P' , SignedAmount, -1 ) as PREMIUM_TEST,

AmountType = 'P' as _AmountIsP

Resident

[Your source]

awqvuserneo
Creator
Creator

Hi Marcon,

After you load the script, try to see whether the data is properly populated via Table Viewer (CTRL+T) .

If the field and the data is okay, then what's your expression look like?

Try: Sum(PREMIUM)

Best,

Anton

Not applicable
Author

Thank you all for you responses.  It's now working.

Vegar
MVP
MVP

Sounds great.

A tip: you should mark the question  as answered. So that future problem seekers will know it is solved and future problem solvers don't need to open it for trying to help.