Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
edwi0012
Contributor III
Contributor III

Qlik sense set-analysis on chart dimentsion

Hi!

I'm trying to show reports vs time for an operation and compare it with a target. The target can't be measured normally on on the coating operation operation. Instead I want to have the target as a function of OrderQTY and CarrierQTY. 

The expression looks like this:

Sum({$<$(CoatingOperations)>}[Target]) /
    ( sum({$<FlagLast90Days={'1'},$(CoatingOperations))>}[OrderQTY])/
       sum({$<FlagLast90Days={'1'},$(CoatingOperations))>}CARRIERQTY)
    )
 
and 
 

sum({$<FlagLast90Days={'1'},$(CoatingOperations))>}[OrderQTY])/
       sum({$<FlagLast90Days={'1'},$(CoatingOperations))>}CARRIERQTY)  should evaluate to a constant value of e.g. 250 based in the last 90 days.

What we will have is then 

Sum({$<$(CoatingOperations)>}[Target]) / 250

Seems straight forward? But in a bar graph which has Target vs date. It doesn't get a constant value. It's evaluated for every single date. How can I define a value that is evaluated for certain selections before it's evaluated in the graph?

The target should change for every date, but orderQTY/CarrierQTY should be a constant evaluated for the last 90 days. 

I've tried to include Date=, so the latter part should ignore the dimension. But that means I can't make any date selections anymore, which is relevant to see the target for different date. How can I calculate a constant in the front end and use it in visualisations?

 sum({$<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}[OrderQTY])/
       sum({$<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}CARRIERQTY)

Thanks for replies

Edvard

 
Labels (3)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Override the dimensions with TOTAL:

sum({$<FlagLast90Days={'1'},$(CoatingOperations))>} TOTAL OrderQTY)/
       sum({$<FlagLast90Days={'1'},$(CoatingOperations))>} TOTAL CARRIERQTY)

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

View solution in original post

8 Replies
Anil_Babu_Samineni

May be try this way

 sum({1<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}[OrderQTY])/
       sum({1<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}CARRIERQTY)

Or

If(GetSelectedCount(Date)>0,  

sum({1<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}[OrderQTY])/
       sum({1<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}CARRIERQTY)
,

sum({$<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}[OrderQTY])/
       sum({$<FlagLast90Days={'1'},Date=, $(CoatingOperations))>}CARRIERQTY)
)

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
edwi0012
Contributor III
Contributor III
Author

It will still count the KPI (Target/(orderQTY/CarrierQTY) different for each single day of the week. I know and have checked that the target is constant during most weeks, it changes between weeks and some individual days of the year. 

I want to calculate a sum(OrderQTY)/sum(CarrierQTY) variable that should be based on the last 90 days. Then divide the daily target with that constant numerical value and be able to do date selections. But the OrderQTY and CarrierQTY will change depending on the date selections and if I exclude the date selections it won't be agile and in a bargraph it will still do the calculations based on date, even if it's excluded in set analysis since it's a dimension. 

Anil_Babu_Samineni

What is the "CoatingOperations"?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
edwi0012
Contributor III
Contributor III
Author

It's a visualisation for a production and especially target exists for multiple operations, but specifically the coatingoperation measures vs their OrderQTY/CarrierQTY. basically, that's inhouse specific selection.

Anil_Babu_Samineni

How did you define the variable?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
edwi0012
Contributor III
Contributor III
Author

That vairable is unfortunatlely not the issue, it's just a setanalysis for selection specific operations. I'm using it and similar on many places elsewhere in the visualizations, therefore I put it in a variable instead, to be able to change at one place instead of many. 

But if I could do that to the latter part it would solve the problem. when I make a variable of sum(OrderQTY)/sum(CarrierQTY) with all the set analysis for selections. When I use it, the variable expansion put's in the code in the function and evaluating there, which interfere with my dimensions and selections.

vL.factor = sum(OrderQTY)/sum(CarrierQTY) = e.g. 250

How it is:

f(x) = Target/$(vL.factor) = Target / sum(OrderQTY)/sum(CarrierQTY) 

How I need it, because of the set analysis inside vL.factor
f(x) = Target /$(vL.factor) = Target / 250

 

Is it more clear now what I'm searching for? Is this possible in anyway?

jonathandienst
Partner - Champion III
Partner - Champion III

Override the dimensions with TOTAL:

sum({$<FlagLast90Days={'1'},$(CoatingOperations))>} TOTAL OrderQTY)/
       sum({$<FlagLast90Days={'1'},$(CoatingOperations))>} TOTAL CARRIERQTY)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
edwi0012
Contributor III
Contributor III
Author

Thanks! This seems to be giving the correct result! Have to read up more on how that keyword works 😉

Thanks again

Regards

Edvard