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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Expression between min and max

Hi.

Can you help me with this:

I have a table showing price for kg, and I need to find the right price for the total weight.

min_kgmax_kgprice
0452,99
453001,1
3005001,04
5009999999999990,99

i tried this formula, and it gives me nothing:

=sum({$<min_kg ={"<$TOTAL_WEIGHT"},max_kg=

{">=$TOTAL_WEIGHT"}>} price)

and this formula gives me the total for all the prices, but not one single line

sum({<TOTAL_WEIGHT= {">$(min_kg)<=$(max_kg)"}>

} price)

6 Replies
Not applicable
Author

Hi,

You have to remove the Dimensions min_kg, Max_kg else it will display the price all the weights.

Regards,

Chandra

Not applicable
Author

Hi thanks.

But I need to find the right price. The TOTAL_WEIGHT is in a different table and there is no link between them. If customer A buys 350 kg he should pay 1,04 for the kg, but if he buys 25 kg he should pay 2,99 for each kg.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can't solve this with set analysis expressions since those are calculated once per chart and not per row. You can probably solve this in the load script using the intervalmatch function to match TOTAL_WEIGHT with the interval defined by min_kg and max_kg. That way you can match the correct price to the TOTAL_WEIGHT. Attached is an example that demonstrates the intervalmatch function.


talk is cheap, supply exceeds demand
Not applicable
Author

i thik it rt why this one i dont no

Not applicable
Author

Thanks, I will solve it in the load script

Clever_Anjos
Employee
Employee

Try set intersection

=sum({$<min_kg ={"<$TOTAL_WEIGHT"}*{">=$TOTAL_WEIGHT"}>} price)