Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sachinryeola
Contributor II
Contributor II

Combo chart with intervals on x axis

Hi guys,

Please help me regarding combo chart with intervals on x axis

As you can see in image

1) on x axis - intervals are made positive on right side and negative on left side

2) bar with color blue shows debit amount

3) bar with green shows credit amt

4) line shows no of lines selected

Plz help me hoe to do this?

Regards,

Sachin

1 Reply
rubenmarin

Hi Sachin, for 1) in the load script you can create buckets using dual to sort in buckets in correct order, in example:

Amounts:

LOAD Amount,

    Dual(If(Amount<0, Num(Num('1'& Repeat('0', Long))*-1, '#.##0') & '...' & If(Long<=2, 0, Num(Num('1'& Repeat('0', Long-1))*-1, '#.##0')),

           If(Long<=1, 0, Num(Num('1'& Repeat('0', Long-1)), '#.##0')) & '...' & Num(Num('1'& Repeat('0', Long)), '#.##0'))

         , Index) as Bucket;

LOAD Amount,

    Len(fabs(Amount)) as Long,

    Len(Amount) * If(Amount<0, -1, 1) as Index;

LOAD * Inline [

    Amount

    -99000000

    50000

    -1

    0

    150000

];

For 2) and 3) you can use the bucket index in background color of the bars like:

If(Bucket<0, [BlueColorRGB], [GreenColorRGB])

For 4) I think you only need an expression like:

Count(Amount)

Hope this helps!