Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Branching and not able to use set analysis

Hi i have posted a previous message asking about set analysis and IF statements;

in the case i post below i would like to build the knowledge whereby i can use set analysis for two potential outcomes  based on the IF condition

example:

IF(OrderRowRab = 'N',

sum([sellingprice] * [xchange] * [total]),

sum([sellingprice] * [xchange] * [total]) * (1+ headerdisc) * (1+rowdiscount))

i would like to make this a set analysis statement or find another way that i can aggregate the data onto a date dimension ie. Year or month or even Order.

as you see in the example it is replication the ordernummer 5 times(depending on the look up on the Row for the value 'N').

i would like it to show the ordernummer and the aggregate only not repeating.

any help is greatly appreciated

Best,

Bradley

4 Replies
Gysbert_Wassenaar

It's not possible to rewrite this as a set analysis expression. A set analysis expression calculates one set for the entire chart to filter the values used in the calculation of the expression. It cannot be used for execution branching.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you for your explanation.

is there a potential way to express this without including all the fields in a table?

Best,

Bradley

Not applicable
Author

There is a workaround. You can create two columns each one with one Set expression then you set them to Conditional display = 0 and you create a third column where you have your test. i.e.
If(Isnull(Test), Column1, Column2)

sunny_talwar

This might be a set analysis alternative to your if statement:

RangeSum(

Sum({<Radnummer = {"=Len(Trim(OrderRad_Ej_OHRabatt)) > 0"}>}If(IsNull([Förs-kurs]),1,[Förs-kurs])),

Sum({<Radnummer = {"=Len(Trim(OrderRad_Ej_OHRabatt)) = 0"}>}If(IsNull([Förs-kurs]),1,[Förs-kurs])) *

(1 + Only({<Radnummer = {"=Len(Trim(OrderRad_Ej_OHRabatt)) = 0"}>}OrderRad_Rabatt)) * (1+Only({<Radnummer = {"=Len(Trim(OrderRad_Ej_OHRabatt)) = 0"}>}OrderHuvud_Rabatt)))

* [Förs pris] *[Ursprungligt antal]

Capture.PNG