Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
phoenix
Creator
Creator

Changing a pivot table with two dimension and one expression into a line graph having one line for each dimension value

Hi,

I have below pivot table

I need to convert this to line graph like below, each line representing a value of dimension2

Currently I am exporting the pivot to excel and creating the graph, how can I do it in qlikview? I cannot have separate expression for each year in the pivot table, it has to be only one expression.

Final result I would need from this is to identify the point in the graph where the percent is 50%, in the above example it is around 17.

How can I extract this information from the pivot or graph? so when the user makes his selection, not only he is seeing the graph but also the age at which it becomes 50%.

Thanks

5 Replies
settu_periasamy
Master III
Master III

Hi Siva,

Can you provide the sample excel file?

phoenix
Creator
Creator
Author

   

TOB2011201220132014201520162017
092.94%93.12%94.18%94.61%94.49%93.49%93.64%
189.94%90.33%91.57%92.60%92.63%91.72%91.52%
286.84%87.47%88.53%89.46%89.55%88.85%88.53%
383.60%84.63%85.47%86.33%86.50%85.94%85.62%
480.36%81.80%82.51%83.25%83.48%83.03%82.63%
576.98%78.73%79.47%80.15%80.40%80.11%79.42%
673.58%75.51%76.51%77.12%77.39%77.21%76.32%
770.74%72.79%73.84%74.36%74.69%74.57%-
868.05%70.15%71.21%71.66%72.00%72.00%-
965.44%67.52%68.57%68.96%69.34%69.44%-
1062.79%64.88%65.95%66.27%66.72%66.90%-
1160.17%62.24%63.29%63.55%64.07%64.31%-
1257.76%59.72%60.65%60.89%61.43%61.75%-
1355.47%57.32%58.12%58.36%58.89%59.26%-
1453.13%55.01%55.71%55.87%56.45%56.81%-
1550.81%52.74%53.33%53.44%54.03%54.52%-
1648.55%50.50%51.02%51.09%51.68%52.26%-
1746.32%48.35%48.76%48.77%49.38%50.16%-
1844.16%46.27%46.52%46.51%47.14%48.09%-
1942.02%44.18%44.37%44.29%44.93%--
2039.94%42.16%42.21%42.10%42.76%--
2137.90%40.15%40.07%39.96%40.61%--
2235.89%38.18%37.94%37.82%38.48%--
2333.90%36.19%35.81%35.69%36.36%--
2431.95%34.23%33.75%33.65%34.28%--
2530.16%32.39%31.80%31.66%32.30%--
2628.47%30.64%29.91%29.81%30.37%--
2726.82%28.97%28.10%28.02%28.55%--
2825.22%27.30%26.35%26.30%26.77%--
2923.72%25.71%24.64%24.59%25.03%--
3022.27%24.18%23.00%22.96%23.53%--
3120.85%22.70%21.41%21.39%---
3219.51%21.24%19.86%19.85%---
3318.18%19.81%18.36%18.37%---
3416.90%18.44%16.90%16.89%---
3515.70%17.09%15.51%15.48%---
3614.62%15.84%14.23%14.18%---
3713.71%14.75%13.12%13.01%---
3812.88%13.72%12.09%11.93%---
3912.07%12.73%11.10%10.93%---
4011.30%11.80%10.16%10.04%---
4110.56%10.90%9.25%9.26%---
429.83%10.03%8.39%8.41%---
439.14%9.20%7.54%----
448.48%8.42%6.73%----
457.81%7.65%5.97%----
467.18%6.90%5.22%----
476.55%6.23%4.56%----
485.97%5.65%4.07%----
495.44%5.12%3.63%----
504.93%4.64%3.21%----
514.45%4.18%2.83%----
524.01%3.75%2.45%----
533.58%3.36%2.07%----
543.18%3.01%1.78%----
552.81%2.68%-----
562.45%2.36%-----
572.13%2.06%-----
581.84%1.78%-----
591.57%1.53%-----
601.37%1.36%-----
611.23%1.22%-----
621.12%1.12%-----
631.01%1.04%-----
640.93%0.97%-----
650.85%0.89%-----
660.78%0.85%-----
670.71%------
680.65%------
690.60%------
700.55%------
710.50%------
720.45%------
730.41%------
740.39%------
750.37%------
760.34%------
770.33%------
780.29%------
79-------
80-------
81-------
82-------
83-------
84-------
85-------
86-------
87-------
88-------
89-------
90-------
phoenix
Creator
Creator
Author

I have converted the percentages to zero decimal and highlighted using background color ->

=if([result3]>=0.49 and [result3]<=0.514,lightred())

Now I just need to take average of the TOB's where it went close to 50%. So here it would be (15*1)+(16*3)+(17*2)/6 = 16.66

settu_periasamy
Master III
Master III

Hi,

Maybe like attached

Capture.JPG

phoenix
Creator
Creator
Author

Perfect! Thanks settu_periasamy‌ that works. that solves second issue. My first issue was to convert pivot table into a line graph. In my pivot I am using above() and rangesum() functions to do some calculations, so when I convert pivot to line graph its is not giving correct results because it is internally converting the table to straight able and above() is miscalculating. thought there would be a work around to directly convert a pivot to line graph without changing the table structure. Thanks!

Sorry I am not able to send the data I am working on, but below is the pivot structure.

pivot table structure:

dimensions:

TOB_calculated

Vintage_yr

expressions:

result3:

if(TOB_calculated <= MAX_TOB_VINTAGE_YR,

if(MAX_LOAN_VINTAGE_MTH>=12 or TOB_calculated = 0,
(
sum(UNPD_PRIN_BAL_AMT)/SUM (ORG_PRIN_AMT)),
if(rank(-if(MAX_LOAN_VINTAGE_MTH<12,TOB_calculated))=1,
(
above(sum(UNPD_PRIN_BAL_AMT)/SUM (ORG_PRIN_AMT))

(
sum(UNPD_PRIN_BAL_AMT)-above(if(MAX_LOAN_VINTAGE_MTH>12, sum(UNPD_PRIN_BAL_AMT), sum(if(MAX_TOB_VINTAGE_YR_MTH > TOB_calculated, UNPD_PRIN_BAL_AMT)))))/SUM (ORG_PRIN_AMT)),
RangeSum(Above([result3]),(sum(UNPD_PRIN_BAL_AMT)-above(if(MAX_LOAN_VINTAGE_MTH>12, sum(UNPD_PRIN_BAL_AMT), sum(if(MAX_TOB_VINTAGE_YR_MTH > TOB_calculated, UNPD_PRIN_BAL_AMT)))))/SUM (ORG_PRIN_AMT)))
),
null()) 

Until certain TOB_calculated for a given Vintage_yr, calculation is straight, but after I hit the limiting point, I need to refer back to the same expression(result3) for previous Tob_calculated and add the delta. That's where it gets complicated. wish I can do this without using above() and rangesum() function.