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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
dseelam
Creator II
Creator II

Calculate Percentage in load script

Hello All,

How to Calculate Percentage in load script, We give allowance to customers on top of gross sales, I have $ amounts given on CSV for allowance how to calculate allowance% from it, in load script itself?

Attached Sample

Thanks,

D

Labels (1)
1 Solution

Accepted Solutions
ahaahaaha
Partner - Master
Partner - Master

Hi,

If I understood you correctly, maybe like this?

LOAD

    ITEM_NUMBER,

    GROSS_SALES,

    fabs( ALLOWANCES) as ALLOWANCES,

(ALLOWANCES/GROSS_SALES)*100 as Percentage

FROM

(txt, utf8, embedded labels, delimiter is ',', msq);

View solution in original post

2 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi,

If I understood you correctly, maybe like this?

LOAD

    ITEM_NUMBER,

    GROSS_SALES,

    fabs( ALLOWANCES) as ALLOWANCES,

(ALLOWANCES/GROSS_SALES)*100 as Percentage

FROM

(txt, utf8, embedded labels, delimiter is ',', msq);

sunny_talwar
MVP
MVP

May be this?

fabs(ALLOWANCES)/GROSS_SALES as [ALLOWANCE %]