Skip to main content

Announcements
Week 4: Discover ELT + ETL Strategies and Explore Predictive AI in Qlik Cloud - WATCH NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III

% age issue

Hi Community,

PFA,

I am using % age Expression

sum(variance)/sum(total varience)


but it does't show % age value




--Paul

1 Solution

Accepted Solutions
swuehl
MVP

Ok, then just replicate your original expression for the denominator with the TOTAL qualifier:

=Variance /

(Count(TOTAL {$<[Type of Data] = {'Forecast'}>} Qty) + Count(TOTAL {$<[Type of Data] = {'Actual'}>} Qty))

View solution in original post

5 Replies
swuehl
MVP

You can't reference an expression label in another aggregation function like sum(Variance) [variance being an expression label).

It seems to me that you want to calculate

=sum(Qty) / sum(TOTAL Qty)

[and set the number format to percentage].

paulwalker
Creator III
Author

Hi Swuehl,

Sorry i am using count({$<[Type of Data] = {'Forecast'}>} Qty)

not a Sum

swuehl
MVP

That's not what I see in your sample app. But it doesn't really matter.

You can't reference an expression label inside another aggregation function (sum(), count(), avg(), min(), ...).

You need to either replicate the expressions (and maybe use advanced aggregation), or rethink your expression (like above, the sum of your first two expressions is just an aggregation with no filter, since the first two sum()s are complementary filtered.

paulwalker
Creator III
Author

here i want to calculate variance % age only

[Type of Data] column name, but i have different type of field data..

Please find Attachment fine once......

swuehl
MVP

Ok, then just replicate your original expression for the denominator with the TOTAL qualifier:

=Variance /

(Count(TOTAL {$<[Type of Data] = {'Forecast'}>} Qty) + Count(TOTAL {$<[Type of Data] = {'Actual'}>} Qty))