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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
noviceneil
Partner - Contributor III
Partner - Contributor III

Help needed for table visualization

Hello Experts, 

                           I need some help on the following,

I have a Input table A which can have more than 500 rows. In the Values column, for same row level 3 kind of values provided. Like ,

ABC_10_1001/01/2020101015000
ABC_10_3001/01/202010300.72
ABC_10_4001/01/2020104010800

 

Here for same Row ABC_10, the first row is the current value, 2nd row is the applicable percentage and 3rd row is the  derived current value (row1*row2). Following same logic , the final expected basic output is given below

INPUT TABLE A:

KeyDateROWColumnValues
ABC_10_1001/01/2020101015000
ABC_10_3001/01/202010300.72
ABC_10_4001/01/2020104010800
ABC_20_1001/01/2020201045000
ABC_20_3001/01/202020300.93
ABC_20_4001/01/2020204041850
ABC_30_1001/01/2020301060000
ABC_30_3001/01/202030300.87
ABC_30_4001/01/2020304052200
ABC_10_1001/02/2020101015500
ABC_10_3001/02/202010300.72
ABC_10_4001/02/2020104011160
ABC_20_1001/02/2020201045200
ABC_20_3001/02/202020300.93
ABC_20_4001/02/2020204042036
ABC_30_1001/02/2020301061000
ABC_30_3001/02/202030300.87
ABC_30_4001/02/2020304053070

 

OUTPUT Needed Basic visualization :

RowApp. Perc.CurrentValuePrevious ValueDifference
ABC_100.721116010800360
ABC_200.934203641850186
ABC_300.875307052200870

 

In theory, I want to show the percentages ( values with column id 30) in a  column "App. Perc.",  all values with date 01/02/2020 and column id 40 in column "Current Value" and all values with date 01/01/2020 and column id 40 in column "Previous Value" and Difference getting calculated by Current Value - Previous Value.

Any lead will be very much helpful.

2 Replies
Digvijay_Singh
MVP
MVP

May be something like this in attached qvf

Digvijay_Singh_0-1620397615473.png

 

Digvijay_Singh_1-1620397641099.png

 

JuanGerardo
Partner - Specialist
Partner - Specialist

Hi @noviceneil, you can use the group by clause to get all your data aligned by row and date:

InputTable:
Load
Left(Key, 6) AS Row,
Date,
If(Column = 10, Values) AS CurrentValue,
If(Column = 30, Values) AS AppPerc,
If(Column = 40, Values) AS DerivedValue
Inline [
Key,Date,ROW,Column,Values
ABC_10_10, 01/01/2020, 10, 10, 15000
ABC_10_30, 01/01/2020, 10, 30, 0.72
ABC_10_40, 01/01/2020, 10, 40, 10800
ABC_20_10, 01/01/2020, 20, 10, 45000
ABC_20_30, 01/01/2020, 20, 30, 0.93
ABC_20_40, 01/01/2020, 20, 40, 41850
ABC_30_10, 01/01/2020, 30, 10, 60000
ABC_30_30, 01/01/2020, 30, 30, 0.87
ABC_30_40, 01/01/2020, 30, 40, 52200
ABC_10_10, 01/02/2020, 10, 10, 15500
ABC_10_30, 01/02/2020, 10, 30, 0.72
ABC_10_40, 01/02/2020, 10, 40, 11160
ABC_20_10, 01/02/2020, 20, 10, 45200
ABC_20_30, 01/02/2020, 20, 30, 0.93
ABC_20_40, 01/02/2020, 20, 40, 42036
ABC_30_10, 01/02/2020, 30, 10, 61000
ABC_30_30, 01/02/2020, 30, 30, 0.87
ABC_30_40, 01/02/2020, 30, 40, 53070
];

OutputTable:
NoConcatenate
Load
Row,
Date,
Avg(AppPerc) AS AppPerc,
Sum(CurrentValue) AS CurrentValue,
Sum(DerivedValue) AS DerivedValue
Resident InputTable
Group By Row, Date;

Drop Table InputTable;

You will get a table like this:

JuanGerardo_0-1620398838323.png

So now, operate with this data can make very easy the expected calculations, for example:

Difference = Sum({<Date={'$(=Max(Date))'}>} CurrentValue) - Sum({<Date={'$(=Max(Date) - 1)'}>} CurrentValue)

 

JG