Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mengelhardt
Contributor III
Contributor III

Chart Main Expression

Hi all,

as a Qlik-Newbie I have the task to create a chart with the following formula from an older project:

Chart Main Expression =sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1}>}total <SubGroups> Sales)

If I put this into a  measure formula, but unfortunately there is an Error, I think it's because of the <SubGroups> . 

The only information I have is that SubGroups is a Dimension with three Items.

 

Could someone help me or give me a hint what do I have to look up in the Qlik help?

Sorry for the cryptic information. 

 

Thanks in advance!

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Mengelhardt
Contributor III
Contributor III
Author

Hi all,

For later readers of this topic, here is the solution of what this expression means (unfortunately the Qlik help isn't very helpful here).

sum({$<likes_basis = {1}>}total <SubGroups> Sales) 

First of all: I have a Stacked Bar Chart with dimensions  "Likes_basis" and "Subgroups".

"total <SubGroups> Sales" then means that all the values of Likes_basis a calculated by each of the items of "Subgroups"  regarding "Sales".

Best Regards

 

 

 

 

 

 

 

 

View solution in original post

9 Replies
NitinK7
Specialist
Specialist

try below expression

=sum({<like = {1}>} sales)
/
sum(total {<likes_basis ={'1'}>} sales)

 

Mengelhardt
Contributor III
Contributor III
Author

Thanks, this works (I've already tried this, indeed)  , but I need the <SubGroups> for filtering, too.

Anyone an idea how to fix sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1}>}total <SubGroups> Sales)

sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1}>}total <SubGroups> Sales)

?

Sivapriya_d
Creator
Creator

are you looking for something like this ?
sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1},Subgroups={'Item1'}>} Sales)

Mengelhardt
Contributor III
Contributor III
Author

Looks good, I'll try this!

Thanks a lot! 

Chanty4u
MVP
MVP

Hi 

can you try below steps.

take one KPI object and put below exp

sum({$<likes = {1}>} Sales)

take another KPI object and put below exp

sum({$<likes_basis = {1}>} Sales)

other kpi

sum({$<likes_basis = {1}>}total <SubGroups> Sales)

other KPI 

sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1}>}total <SubGroups> Sales)

 

see the result  which is having issue post the error screenshot here.

 

Mengelhardt
Contributor III
Contributor III
Author

I've tried: 

The first two KPIs work fine, in the third there is the Error: "Error in Expression" , I think the Syntax is not correct. 

What can  "total <SubGroups> Sales"

mean?

I've never seen anythink like this in Set Analysis.  

 

Chanty4u
MVP
MVP

try this

 

sum({$<likes = {1}>} Sales) / sum(total <SubGroups>{$<likes_basis = {1}>} Sales)

or

 

sum({$<likes = {1}>} Sales) /sum(aggr( sum({$<likes_basis = {1}>}total <SubGroups> Sales),SubGroups)

or

sum(aggr(sum({$<likes = {1}>} Sales) / sum({$<likes_basis = {1}>}total <SubGroups> Sales),SubGroups)

 

Mengelhardt
Contributor III
Contributor III
Author

Great, thank you. I'll try this! 

Thanks to the awesome crowd here! You helped me a lot!

 

Mengelhardt
Contributor III
Contributor III
Author

Hi all,

For later readers of this topic, here is the solution of what this expression means (unfortunately the Qlik help isn't very helpful here).

sum({$<likes_basis = {1}>}total <SubGroups> Sales) 

First of all: I have a Stacked Bar Chart with dimensions  "Likes_basis" and "Subgroups".

"total <SubGroups> Sales" then means that all the values of Likes_basis a calculated by each of the items of "Subgroups"  regarding "Sales".

Best Regards