Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis help.

Please see the attached QVW.

Trying to get the count of ID with 75k Target but the expression is not working for me.Can anyone help me here please ?

Thanks much.

1 Solution

Accepted Solutions
sunny_talwar

Are you counting Per Platform, Per Year >= 75k

May be try this script:

LOAD *,

AutoNumber(Platform&Year) as Key;

Load  * Inline [

Platform,Year,Amount

ABC,2015,76000

ABC,2015,6000

ABC,2016,70999

ABC,2016,2000

DEF,2015,56000

DEF,2015,5000

DEF,2016,55000

DEF,2016,5000

];

And then this expression:

=Count({<[Year] =  {'2016'}, Key = {"=Sum([Amount]) >=75000"}>} Platform)

=Count({<[Year] =  {'2016'}, Key = {"=Sum([Amount]) < 75000"}>} DISTINCT Platform)

View solution in original post

4 Replies
Gysbert_Wassenaar

The QVW you attached does not contain a field ID and does not contain a field Target. Please explain what you're trying to do. Give examples.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hey!
As far as I understood your issue the thing is that you get the number of IDs which reflects the number of rows in your model but not the number of IDs. To count the number of IDs you have to add distinct into your function:

=count({<[Year] =  {'2016'}, Platform = {"=sum([Amount]) >=75000"}>} distinct Platform )

         

Then on your Bar-chart you will have 2 instead of 4.

Hope it helps

Elena

sunny_talwar

Are you counting Per Platform, Per Year >= 75k

May be try this script:

LOAD *,

AutoNumber(Platform&Year) as Key;

Load  * Inline [

Platform,Year,Amount

ABC,2015,76000

ABC,2015,6000

ABC,2016,70999

ABC,2016,2000

DEF,2015,56000

DEF,2015,5000

DEF,2016,55000

DEF,2016,5000

];

And then this expression:

=Count({<[Year] =  {'2016'}, Key = {"=Sum([Amount]) >=75000"}>} Platform)

=Count({<[Year] =  {'2016'}, Key = {"=Sum([Amount]) < 75000"}>} DISTINCT Platform)

Not applicable
Author

You are awesome.