Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pratigya27
Partner - Contributor
Partner - Contributor

How create buckets in load script?

Create the following buckets for Discount:

    0-0.05

    0.06-0.1

    0.1-0.15

    0.16-0.25

 

    Show no. of Orders by Discount bucket for Order Priority = "Low". By default, this should show data for 2012 else for the maximum selected year.

 

1 Reply
andoryuu
Creator III
Creator III

If you want a precise answer you'll need to provide more information about your data and data load script at a minimum, but if you're looking to do this in Qlik's engine script language it would likely be the following depending on your data:

 

TableWhatever:

LOAD *, If(Discount>= 0 and Discount<=.05,"Low",if(Discount>.05 and <= .1,"This level",if(Discount>.1 and Discount<=.15,"This Other Level",if(Discount>.15 and Discount <=.25,"Another level","No level"))));

[Your source like SQL or or file or whatever];