Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Formula

Hi there, 

Master measure below does not apply when I select a project.

Count({<[Project Name]>} IF([Physical % Complete] <'100%', [Project Name]))

Is there any other way I can re-formulate this expression so that when I select project  it returns related values?
Thanks a million

Jose

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

make this modification in the script to create a primary key:

([Project Name] &
ActivityID & [Activity Name] ) as KEY0;

in UI:

=Count( {< KEY0 = {"=[Physical % Complete]=1"} >} KEY0 )

View solution in original post

14 Replies
NitinK7
Specialist
Specialist

try once

IF([Physical % Complete] <'100%', Count({<[Project Name]>} [Project Name] ))

agigliotti
Partner - Champion
Partner - Champion

Hi @JoseGarcia ,

Maybe this:

Count(  {< [Project Name] = {"=[Physical % Complete] <100%"} >}  [Project Name] )

I hope it can helps.

Best Regards

JoseGarcia
Creator III
Creator III
Author

@agigliotti

expression returned an error. 😞
JoseGarcia_0-1616143284495.png

a bracket somewhere?

Jose

JoseGarcia
Creator III
Creator III
Author

@NitinK7 , 

Formula is correct but  does not return correct value. 

JoseGarcia_1-1616143451257.png

any ideas?

agigliotti
Partner - Champion
Partner - Champion

what about [Physical % Complete] field values?

are those numeric values from 1 to 100 ?

is so you have to change the expression as below:

=Count( {< [Project Name] = {"=[Physical % Complete]<100"} >} [Project Name] )

else you can try with:

=Count( {< [Project Name] = {"=[Physical % Complete]<1"} >} [Project Name] )

do you have only one [Physical % Complete]  value for each project?

JoseGarcia
Creator III
Creator III
Author

@agigliotti , 

I have attached data table for guidance.
Raw data is under Combined tab. 
Both expression did return 0.

 

Hope the excel file, can provide clarity.

Jose

agigliotti
Partner - Champion
Partner - Champion

Below you find the script:

load *,
([Project Name] &
ActivityID ) as KEY0;
LOAD [Project Name],
ActivityID,
[Activity Name],
[Remaining Duration],
Finish,
[BL Project Finish],
[Late Finish],
[EPPR (A)],
[ActOwner (A)],
[Physical % Complete],
Variance,
F12,
Actual,
Baseline,
O
FROM
[C:\Users\Andrea\Downloads\Copy of Delivery Bar Chart V19 2-0202021 for QlikSense.xlsx]
(ooxml, embedded labels, table is Combined);

in UI you can use:

=Count( {< KEY0 = {"=[Physical % Complete]<100"} >} DISTINCT [Project Name] )

Best Regards

JoseGarcia
Creator III
Creator III
Author

@agigliotti ,

followed steps. 
But not getting correct result.

If we take Leeds project, measure should return '105' 

Jose

agigliotti
Partner - Champion
Partner - Champion

Based on excel data why the result for Leeds project should be 105?

Sorry but I can't understand the logic behind...

Also what is the primary key of that "Combined" excel sheet ?