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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting an expression

Hi all,

Good day.

Is there any way that I can count the number of times that the certain sum of an expression is equal and/or higher than the sum of another expression?

Here's what I want to do:

Having date and product as dimensions, i've got these expressions:

Sum(Qty ordered)

Sum (Qty shipped)

Important: Both quantities come from different tables.

Whenever Qty shipped is equal or higher than Qty Ordered, I have a calculated QV expression with the if function called the Shipment Status that sets its value to '1'. Here's an example.

                                             Days      01.12         02.12       03.12       04.12        05.12

Product  A  Sum(ordered)                      2                2              2             2                2

                   Sum(shipped)                      1                1              2             2                3

                   Shipment Status                    0                0              1             1                1

What I need is to count the number of times, by product, that the shipment qty was equal or greater than the ordered.

Does anyone have any ideas on this?

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

set an indicator in your load script and assign whenever your criteria are met 1 to FieldCount else 0

in the graph use sum(FieldCount) in order to count...

hth

F

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If the Product and the Date are dimensions on a chart or table, then use this for the status column/row

     =If(Sum(Qty shipped) > Sum(Qty ordered), 1, 0)

This assumes that they are correctly associated with the same date.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

set an indicator in your load script and assign whenever your criteria are met 1 to FieldCount else 0

in the graph use sum(FieldCount) in order to count...

hth

F

agomes1971
Specialist II
Specialist II

Hi,

Yes this should do the trick...

Regards

André Gomes

Not applicable
Author

Hi Felix,

Thanks your your reply.

How would that exactly be done?

Quantity Ordered and Quantity Shipped come from different tables that relate to each other using Product and Date as keys.

Not applicable
Author

Hi Jonathan,

Thanks your for reply.

I'm already using that expression.

What I want to do is to count the number of times I get a 1.

Not applicable
Author

Hi,

you can read and merge the 2 tables using the join or concatenate statements

and add the countfield depending on the criteria you have.

cheers

F.