Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

andyrebs
New Contributor

Expression Count*sum

Dear All,

I changed the source from a file to an ODBC Database.
Before I had an excel file with the vorious data of the Ticket (TT) on a line and the fields 'Repair Time' and 'expected repair time' in two columns.
To find the sum of the scheduled hours I had to use the simple expression

sum ([expected repair time]).

But now with the new script field 'expected repair time' is in another table.
I had to change the expression in

= [expected repair time] * Count (DISTINCT (IdTT)).

This new expression works in a chart with dimension ProductId
but the total does not work.
I tried to modify the expression in

= sum (Aggr ([expected repair time], [ProductId])) * Count (DISTINCT (IdTT))

but I always have the same problem with the total.

I also tried to enter the expression in a list box with the field 'TypeTTId', but it shows the same total wrong.

Do you have a suggestion?

thank you very much

Andrea

5 Replies
MVP
MVP

Re: Expression Count*sum

It's hard to answer your question without knowing your data model.

Can you describe in more detail how your tables are linked, and in what context you are using your expressions?

If you could post a small sample file that demonstrate your issue, this would make it even easier to help you.

Regards,

Stefan

andyrebs
New Contributor

Re: Expression Count*sum

Hi Stefan, many thanks for your answer.

I attach for your perusal the tables's map.

Maybe the solution is to concatenate the field [expected repair time] to the table TabChiamate, to build the same table that I had before.

Otherwise I know that you are a Master and you will find the correct answer!

map.png

MVP
MVP

Re: Expression Count*sum

Sorry, i can't find the field names you mentioned above in your table view, you would need to translate the field names to the names used in your application for me.

And I believe it would be much easier if you could prepare a small sample app ;-)

andyrebs
New Contributor

Re: Expression Count*sum

Hi Stefan

[expected repair time] = [Tempo Riparazione]


[ProductId] = [Codice articolo]


Repair Time = [Ore riparazione] but I don't know if you can see this field..

Regarding prepare a small sample app, I should open a new discussion asking 'How to prepare a small sample app', because I don't how to make it! ;-))))) 

best regards

Andrea

andyrebs
New Contributor

Re: Expression Count*sum

I resolved this problem! I simply load the field [expected repair time] on the script with the function JOIN with the Main table.

Many Thanks

Community Browser