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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Graph help

HI, i need help to create a graph.

This is the problem:

Supouse you have the following table with data:

sell_id     SellWeek     AnulationWeek     Amount

      1          1                         1                   100

      2          1                          2                   200

I want to create a graph with the x-axis with week and the y-axis amount. In the week 1 the amount must be 200, beacuse i sold 300 but i have a anulation of 100, in the second the amount must be -200, because i sold 0 and have 200 of anulation.

Can anyone help me?

Thanks,

1 Solution

Accepted Solutions
maxgro
MVP
MVP

I added some records

this is the RESULT,see attachment or below for SCRIPT

2014-03-21 23_37_14-QlikView x64 - [C__Users_mgrossi_Desktop_Z.qvw_].png

Source:

load * inline [

sell_id,     SellWeek,     AnulationWeek,     Amount

      1   ,       1     ,                    1     ,              100

      2   ,       1     ,                     2     ,              200

      3   ,       4     ,                    3     ,              100

      4   ,       5     ,                     4     ,              200

];

L:

load

SellWeek as Week,

1 as Type,

sell_id

resident Source;

load

AnulationWeek as Week,

-1 as Type,

sell_id

resident Source;

View solution in original post

6 Replies
MK_QSL
MVP
MVP

Can you elaborate AnulationWeek ?

Dont understood your requirements fully...:-(

Not applicable
Author

AnulationWeek, is the week when a sell is canceled. Imagine that each row represents a reservation for a flight. And you can cancel that reservation, that is what AnulationWeek means..

MK_QSL
MVP
MVP

Got it, Can you provide 4-5 more sample lines to work?

Not applicable
Author

In the image below its and example in excel.

If Anulationweek=1000 then de anulation week is null, the reservation is available.Captura.JPG.jpg

maxgro
MVP
MVP

I added some records

this is the RESULT,see attachment or below for SCRIPT

2014-03-21 23_37_14-QlikView x64 - [C__Users_mgrossi_Desktop_Z.qvw_].png

Source:

load * inline [

sell_id,     SellWeek,     AnulationWeek,     Amount

      1   ,       1     ,                    1     ,              100

      2   ,       1     ,                     2     ,              200

      3   ,       4     ,                    3     ,              100

      4   ,       5     ,                     4     ,              200

];

L:

load

SellWeek as Week,

1 as Type,

sell_id

resident Source;

load

AnulationWeek as Week,

-1 as Type,

sell_id

resident Source;

Not applicable
Author

Thank you!

It works fine