Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum or count of values within first dimesion

Hi,

I have an issue with getting the sum or count of distinct values within the first of two dimensions in a table.

I have this table:

CountryStoreSales StoreSales Country
USAStore 1100300
USAStore 2100300
USAStore 3100300
UKStore 1200600
UKStore 2200600
UKStore 3200600

The last column, "sales country" is what I am trying to get.

Can anyone help me with an expression that shows me that? I have tried with set analysis and saying TOTAL, but that gives me the total of all countries in the list, unless i filter first. Is there a way of saying (like in excel) sumif(A:A;A2;C:C) ?

Thanks a lot for your help!

Best regards,

Claus

7 Replies
goncalo_ricardo_pereira
Partner - Contributor III
Partner - Contributor III

Hello,

You can try something like this:

sum(TOTAL<Country> [Sales Store])

The "Total<Country>" basically is saying to the expression, ignore all the dimensions except the Country.

Best Regards

simondachstr
Luminary Alumni
Luminary Alumni

Use the below expression

=aggr(sum([Sales Store]),Country)

Anonymous
Not applicable
Author

ayuda 1.PNG.pngayuda 2.PNG.png

Not applicable
Author


Hi all - thanks, those worked for the sum!

Now i would like to do the same for count of distinct product_id in the country, not the store. Is that a possibility?

I tried this

Count(TOTAL DISTINCT <Store_CountryName> [Product_DesignVariationID])

but it only shows the value for 1 of the stores, and i would like it to show the value on all the stores.

Thanks!

Not applicable
Author

Hi - thanks, that worked for the sum!

Now i would like to do the same for count of distinct product_id in the country, not the store. Is that a possibility?

I tried this

Count(TOTAL DISTINCT <Country> [Product_Id])

but it only shows the value for 1 of the stores, and i would like it to show the value on all the stores.

Thanks!

goncalo_ricardo_pereira
Partner - Contributor III
Partner - Contributor III

Hello,

Try This:

count(TOTAL<Country> DISTINCT [Product_Id])

Best Regards

Not applicable
Author

FANTASTIC that worked - thanks!