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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
lessassy
Creator
Creator

Create a field from two existing field in script

Hello everyone,

I had originally a bar chart

with a dimension weekyear and a formula like this :

if(sum(LossBU)/ Count ( {<Breakdown={'Yes'}>} Breakdown)>0,sum(LossBU)/ Count ( {<Breakdown={'Yes'}>} Breakdown),0)

But I want to include that formula in the script  as MTTR because i want it to be a part of a table box

I already tried this

MTTR:


LOAD

LossBU,

Breakdown,


(sum(LossBU)/ Count ( Breakdown=('Yes'))) as MTTR


But it didn't work

I think becasue the 'yes' is include in the field and qlikview don't recognize it BB.PNG

Thank you in advance

3 Replies
kfoudhaily
Partner - Creator III
Partner - Creator III

set analysis shouldn't work on script;

it could be replaced with a group by depending on the case.

can you please provide sample qvw to have a look at data model?

regards,

QlikView Qlik Sense consultant
lessassy
Creator
Creator
Author

Ok here is the sample

of the application.

Thank you

pooja_prabhu_n
Creator III
Creator III

Hi,

you can try like this

T1:

LOAD * INLINE [

BreakDown,LossBU, Year

No, 0, 2018

Yes, 95, 2018

Yes, 60, 2018


];



T2:

LOAD sum(LossBU)/Count(if(BreakDown='Yes',BreakDown)) as MTTR,

Year

Resident T1

Group By Year;