Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
asgardd2
Creator III
Creator III

Problem with create correct expression.

Hello!

     I have 2 transaction tables (Sales,Prognoz in attachment) . They include different type of clients (Client - Client_main).

Mapping table for Client - Client_main in attachment too.

Else, i have table for client classes.

I create data model from this xls files. For example,It has few same rows (prognoz in transactions) for 1 main client, because one main client mapping for few clients.

I want, that expression for prognoz working correctly. Now, in attachment app. it increases threefold

How can i fix it?

Thank you for your reply!

Anton Aleksandrov.

Labels (1)
8 Replies
sunny_talwar
MVP
MVP

May be this

=Sum({<Type_Of_Transaction = {"Prognoz"}>} Account)/Count(DISTINCT Class)

antoniotiman
Master III
Master III

Hi Aleksandrov,

have You trie Sum( DISTINCT value) ?

Regards,

Antonio

asgardd2
Creator III
Creator III
Author

Hello! Yes, i tried this, but on a lot of data it works very slowly.

sunny_talwar
MVP
MVP

How about this?

=Sum({<Type_Of_Transaction = {"Prognoz"}>} Account)/Count(DISTINCT Class)

asgardd2
Creator III
Creator III
Author

Hello, Sunny!

I have flex table to this and It is not working correctly in other selections. (and dimensions)

sunny_talwar
MVP
MVP

I have flex table to this

What is a flex table?

asgardd2
Creator III
Creator III
Author

I mean table, that i load in script via inline load.

After that, i use this table to choose dimensions(show condition) in "Straight table".

asgardd2
Creator III
Creator III
Author

I have solution (working very slowly) with using DISTINCT:

IF(Dimensionality() = 0,

Sum(Aggr(Sum(DISTINCT {<Type_Of_Transaction = {"Prognoz"}>} Account),Client_main,Product)),

Sum(Aggr(Sum(DISTINCT {<Type_Of_Transaction = {"Prognoz"}>} Account),Client_main,Product,!!! dimensions in table !!! ))

999.png