Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Help Set Analysis Expression

Hello,

Please Help in Set Analysis Expression

IF(Sum(OrderQty) - Sum(BillQty) > 0,

Sum(OrderQty))

 

How Can Write This Expression in Set Analysis.

Labels (1)
1 Solution

Accepted Solutions
Highlighted

As I said to your earlier question

Set analysis is a filter, not a conditional, so you cannot implement if(...sum()) type expressions using set analysis.

Assuming thatyou mean SumIf()) and that the quantities apply to some sort of order ID, I would create a flag to indicate when the order qty exceeds the bill qty. Enter code like this after loading your main fact table:

...
Join (Fact)
LOAD ID,
	IF(Sum(OrderQty) - Sum(BillQty) > 0, 1, 0) as BillFlag
Resident Fact
Group By ID;
...

Adjust table and field names to match your data model.

Now use

Sum({<BillFlag = {1}>} OrderQty)

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

View solution in original post

1 Reply
Highlighted

As I said to your earlier question

Set analysis is a filter, not a conditional, so you cannot implement if(...sum()) type expressions using set analysis.

Assuming thatyou mean SumIf()) and that the quantities apply to some sort of order ID, I would create a flag to indicate when the order qty exceeds the bill qty. Enter code like this after loading your main fact table:

...
Join (Fact)
LOAD ID,
	IF(Sum(OrderQty) - Sum(BillQty) > 0, 1, 0) as BillFlag
Resident Fact
Group By ID;
...

Adjust table and field names to match your data model.

Now use

Sum({<BillFlag = {1}>} OrderQty)

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

View solution in original post