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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

edit expression to get percentage

Hi everyone,

I am needing again your help on my project. 

I need to get the percentage of CRITERIA per week and I am having trouble creating formula.

can someone help me what part of my formula needed modification.

Count(lot_id)/Count(TOTAL(lot_id))

see attached for the RAW file.

1 Solution

Accepted Solutions
kaanerisen
Creator III
Creator III

Hi Rita,

I am not sure that if you are trying to sum "plan_hours" and get a percentege over a week by Criteria. If that so, your expression on pivot table should be like this:

Sum(plan_hours)/sum(total <Fiscal_Week> plan_hours)

View solution in original post

5 Replies
aarkay29
Specialist
Specialist

Can you give a example with numbers from your excel please!

kaanerisen
Creator III
Creator III

Hi,

Script:

test:

CrossTable(hours, value, 1)

LOAD

    Fiscal_Week,

    "[(1)<6 HRS]",

    "[(2)6-12 HRS]",

    "[(3)12-24 HRS]",

    "[(4)>24 HRS]"

FROM [lib://downloads/PERCENT PER CRITERIA.xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet2);

Expression:

Sum(value)/sum(total <Fiscal_Week> value)

Result:

percent.png

Anonymous
Not applicable
Author

Hi Kaan,

I have attached a new RAW file.

where below are not a field but a result from the expression.

     [(1)<6 HRS],

     [(2)6-12 HRS],

     [(3)12-24 HRS],

     [(4)>24 HRS],

     [TOTAL LOTID]

how do I edit my formula or script using the attached data.

thanks

kaanerisen
Creator III
Creator III

Hi Rita,

I am not sure that if you are trying to sum "plan_hours" and get a percentege over a week by Criteria. If that so, your expression on pivot table should be like this:

Sum(plan_hours)/sum(total <Fiscal_Week> plan_hours)

Anonymous
Not applicable
Author

Hi Kaan,

I have made some modification with your expression, instead of plan hours I change it to Lot_id and the result is what I am looking for.

Count(LotID)/Count(total <Fiscal_Week> LotID)

thank you!